Created
July 24, 2014 08:20
-
-
Save luckyshot/109db57429ad21054869 to your computer and use it in GitHub Desktop.
Seconds to Time
Given the number of seconds it returns the value in minutes and seconds (i.e. 62 seconds returns 1:02)
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
/** | |
* secsToTime | |
* Given the number of seconds it returns the value in minutes and seconds | |
* (i.e. 62 seconds returns 1:02) | |
*/ | |
function secsToTime(secs) { | |
return (secs / 60).toFixed() +':'+ ('0'+secs % 60).slice(-2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment