Easy question converting numbers to hours

6 views (last 30 days)
Hi all, I know this should be easy, but how would you convert whole numbers into HH:MM format? Like say 1156 into 11:56 ? Thank you

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 1 Sep 2016
Edited: Azzi Abdelmalek on 1 Sep 2016
datestr(datenum(sprintf('%04d',1156),'HHMM') ,'HH:MM')

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by