Created
November 5, 2012 21:46
-
-
Save 06b/4020548 to your computer and use it in GitHub Desktop.
Covert seconds to hours, minutes and seconds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Time = Total Time in Seconds | |
// Minutes and seconds | |
var mins = ~~(time / 60); | |
var secs = time % 60; | |
// Hours, minutes and seconds | |
var hrs = ~~ (time / 3600); | |
var mins = ~~ ((time % 3600) / 60); | |
var secs = time % 60; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment