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

4 visualizaciones (últimos 30 días)
Megha
Megha el 12 de Dic. de 2018
Comentada: Megha el 26 de Dic. de 2018
how to convert 5.5 hour to 05:30:00 HH:MM:SS format?

Respuesta aceptada

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

Más respuestas (1)

Stephan
Stephan el 12 de Dic. de 2018
Editada: Stephan el 12 de Dic. de 2018
a = hours(5.5);
b = datetime('00:00:00','Format','HH:mm:ss');
result = a+b
result =
datetime
05:30:00

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by