how can I add add sec, min and hours to time?
201 次查看(过去 30 天)
显示 更早的评论
I want to add sec, min and hours to a time.
Example:
now it is 07:00:00 am and i would like to add 320 sec to be 07:05:20 am
I try "datenum" but this include a date which I don't want ?
10 个评论
Walter Roberson
2017-11-13
dt = datetime( '23:58:00', 'InputFormat', 'HH:mm:ss' );
dt.Format = 'HH:mm:ss';
dt + seconds(320)
ans =
datetime
00:03:20
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!