Created
October 27, 2016 12:20
-
-
Save perliedman/11a4c2a8395e1abd8653d66dee44d835 to your computer and use it in GitHub Desktop.
Revisions
-
perliedman created this gist
Oct 27, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ var secondsToTime = function(s) { var pad = function(v) { return v < 10 ? '0' + v : v.toString(); } var result = ''; for (var i = 0; i < 3; i++) { result = pad(s % 60) + (i ? ':' : '') + result; s = Math.floor(s / 60); } return result; }