Skip to content

Instantly share code, notes, and snippets.

@abrjagad
Last active August 29, 2015 14:05
Show Gist options
  • Save abrjagad/33eaa2bcdc891f6071e9 to your computer and use it in GitHub Desktop.
Save abrjagad/33eaa2bcdc891f6071e9 to your computer and use it in GitHub Desktop.
Jquery Date
var d, h, m, s,
ms = $newDate - $currentDate;
s = Math.floor(ms / 1000);
m = Math.floor(s / 60);
s = s % 60;
h = Math.floor(m / 60);
m = m % 60;
d = Math.floor(h / 24);
h = h % 24;
console.log(d,h,m,s);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment