how to convert 5.5 hour to 05:30:00 HH:MM:SS format?

4 次查看(过去 30 天)
how to convert 5.5 hour to 05:30:00 HH:MM:SS format?

采纳的回答

Stephen23
Stephen23 2018-12-12
>> datestr(5.5/24,'HH:MM:SS')
ans = 05:30:00

更多回答(1 个)

Stephan
Stephan 2018-12-12
编辑:Stephan 2018-12-12
a = hours(5.5);
b = datetime('00:00:00','Format','HH:mm:ss');
result = a+b
result =
datetime
05:30:00

类别

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