Date time conversion 24

8 次查看(过去 30 天)
Matlabbey
Matlabbey 2013-11-23
评论: Jan 2013-11-23
I have date in three column: HOUR;MINUTE;AM/PM
I have try modestly to convert this to military time (1:00 to 24:59) but the datenum/string do not work.
Is there a method to this?
  1 个评论
Jan
Jan 2013-11-23
What does "date in three column" exactly mean? Is this a string, a file, a cell string or a numerical array?

请先登录,再进行评论。

回答(1 个)

Azzi Abdelmalek
Azzi Abdelmalek 2013-11-23
d='01:30 PM'
new_d=datestr(datenum(d,'HH:MM AM'),'HH:MM')

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by