Skip to content

Instantly share code, notes, and snippets.

@06b
Created November 5, 2012 21:46
Show Gist options
  • Save 06b/4020548 to your computer and use it in GitHub Desktop.
Save 06b/4020548 to your computer and use it in GitHub Desktop.
Covert seconds to hours, minutes and seconds
// Time = Total Time in Seconds
// Minutes and seconds
var mins = ~~(time / 60);
var secs = time % 60;
// Hours, minutes and seconds
var hrs = ~~ (time / 3600);
var mins = ~~ ((time % 3600) / 60);
var secs = time % 60;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment