Timeformat from HH:MM:SS to HHMMSS

6 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
em_++
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
.

Community Treasure Hunt

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

Start Hunting!