Skip to content

Instantly share code, notes, and snippets.

@robertd
Last active December 22, 2015 21:29
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 robertd/6533238 to your computer and use it in GitHub Desktop.
Save robertd/6533238 to your computer and use it in GitHub Desktop.
Milliseconds to hour/min count
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