Skip to content

Instantly share code, notes, and snippets.

@dukex
Forked from lucianosousa/gist:5726640
Last active December 18, 2015 04:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dukex/5727384 to your computer and use it in GitHub Desktop.
Save dukex/5727384 to your computer and use it in GitHub Desktop.
var humanize_time = function(time){
return time > 9 ? time : "0"+time;
}
var milliseconds = 17916;
date = new Date(milliseconds);
humanize_time(date.getUTCMinutes()) + ':' + humanize_time(date.getUTCSeconds());
nowadays: 00:17
expected: 00:17
------------------------------------------------------------------------
milliseconds = 509701
date = new Date(milliseconds);
humanize_time(date.getUTCMinutes()) + ':' + humanize_time(date.getUTCSeconds());
nowadays: 08:29
expected: 08:29
------------------------------------------------------------------------
milliseconds = 727335
date = new Date(milliseconds);
humanize_time(date.getUTCMinutes()) + ':' + humanize_time(date.getUTCSeconds());
nowadays: 12:07
expected: 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment