Created
November 13, 2020 16:44
-
-
Save kingnebby/b389b475390f6c1a2e2530cea0fa65f2 to your computer and use it in GitHub Desktop.
Popular Code Solution
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 humanReadable(seconds) { | |
var pad = function(x) { return (x < 10) ? "0"+x : x; } | |
return pad(parseInt(seconds / (60*60))) + ":" + | |
pad(parseInt(seconds / 60 % 60)) + ":" + | |
pad(seconds % 60) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment