Last active
December 22, 2015 21:29
-
-
Save robertd/6533238 to your computer and use it in GitHub Desktop.
Milliseconds to hour/min count
This file contains hidden or 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
function time(ms) { | |
var hours = Math.floor(ms/3600000), | |
minutes = Math.floor(ms/60000)%60, | |
time = (hours > 0 ? (hours +" hr, ") : "") + minutes + " min"; | |
return time; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment