re-formating time
hi, i was woundering if theres an easy way to reformat milliseconds into something like mm:ss or even hh:mm:ss ??
or if theres anywhere you poeple can point me to on he net that night help, thanks.
For dates (maybe not quite what you want) -> ctime()
Otherwise, do it by hand
Otherwise, do it by hand
unsigned long time = whateverunsigned short ms = time % 1000;time /= 1000;unsigned short s = time % 60;time /= 60;unsigned short m = time % 60;time /= 60;unsigned short h = time % 24;time /= 24;printf( "%u days %02u:%02u:%02u.%03u", time, h,m,s,ms );
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement