Skip to content

Instantly share code, notes, and snippets.

@sax1johno
Created December 16, 2015 01:11
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 sax1johno/5bc569de8a9e8b5a0fbb to your computer and use it in GitHub Desktop.
Save sax1johno/5bc569de8a9e8b5a0fbb to your computer and use it in GitHub Desktop.
var totalSec = yourTime / 1000;
var minutes = parseInt( totalSec / 60 ) % 60;
var seconds = totalSec % 60;
var result = (hours < 10 ? "0" + hours : hours) + "-" + (minutes < 10 ? "0" + minutes : minutes) + "-" + (seconds < 10 ? "0" + seconds : seconds);
@sax1johno
Copy link
Author

var result = minutes + ":" + (seconds < 10 ? "0" + seconds : seconds);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment