How to convert decimal to time?
47 ビュー (過去 30 日間)
古いコメントを表示
eg: 7.6 (7+0.6*60) = 7:36
0 件のコメント
採用された回答
per isakson
2017 年 10 月 10 日
編集済み: per isakson
2017 年 10 月 10 日
datestr takes days as input. Thus, divide by 24.
>> val = 7.6;
>> datestr( val/24, 'HH:MM' )
ans =
07:36
I guessed that seven is hours, not minutes.
その他の回答 (1 件)
Peter Perkins
2017 年 10 月 13 日
編集済み: Peter Perkins
2017 年 10 月 13 日
This depends on what you mean by "time". Likely, the most useful thing is a duration:
>> t = hours(7.6)
t =
duration
7.6 hr
>> t.Format = 'hh:mm:ss'
t =
duration
07:36:00
0 件のコメント
参考
カテゴリ
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!