Timeformat from HH:MM:SS to HHMMSS

11 次查看(过去 30 天)
em_++
em_++ 2021-10-19
评论: Star Strider 2021-10-19
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 个评论
KSSV
KSSV 2021-10-19
In what format you have? An example will help us to you.
em_++
em_++ 2021-10-19
编辑:em_++ 2021-10-19
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

请先登录,再进行评论。

回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by