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

3 vues (au cours des 30 derniers jours)
Megha
Megha le 12 Déc 2018
Commenté : Megha le 26 Déc 2018
how to convert 5.5 hour to 05:30:00 HH:MM:SS format?

Réponse acceptée

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

Plus de réponses (1)

Stephan
Stephan le 12 Déc 2018
Modifié(e) : Stephan le 12 Déc 2018
a = hours(5.5);
b = datetime('00:00:00','Format','HH:mm:ss');
result = a+b
result =
datetime
05:30:00

Catégories

En savoir plus sur Data Type Conversion dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by