Page 1 of 1

Converting Milliseconds into hh:mm:ss

Posted: Thu Apr 28, 2011 1:24 pm
by REwingUK
Hi guys,

So i've pulled through the data from a sql database, and now i'm looking how to convert millieseconds into hh:mm:ss.

The millieseconds i pull through is 167392

Any help is appreciated.

Re: Converting Milliseconds into hh:mm:ss

Posted: Thu Apr 28, 2011 4:00 pm
by pickle
What is that number relative to? That's only 167 seconds.

Re: Converting Milliseconds into hh:mm:ss

Posted: Fri Apr 29, 2011 2:44 pm
by incubi
On Google everywhere :)

Hours = Milliseconds / (1000*60*60)
Minutes = (Milliseconds % (1000*60*60)) / (1000*60)
Seconds = ((Milliseconds % (1000*60*60)) % (1000*60)) / 1000

Lee