Timeformat from HH:MM:SS to HHMMSS

2 views (last 30 days)
em_++
em_++ on 19 Oct 2021
Commented: Star Strider on 19 Oct 2021
Hi!
i want to convert my current time format (-> HH:MM:SS) to HHMMSS.
Is there a easy way to do that?
Thanks in advance!
  2 Comments
KSSV
KSSV on 19 Oct 2021
In what format you have? An example will help us to you.
em_++
em_++ on 19 Oct 2021
Edited: em_++ on 19 Oct 2021
my current format is HH:MM:SS (hour hour: minute minute: seconde second) and i want (hour hour minute minute seconde second).
example :
12:30:00
to
123000

Sign in to comment.

Answers (1)

Star Strider
Star Strider on 19 Oct 2021
Try this —
time = datetime('12:30:00', 'InputFormat','HH:mm:SS', 'Format','HHmmSS')
time = datetime
123000
.

Categories

Find more on Dates and Time in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!