Skip to content

Instantly share code, notes, and snippets.

@pazguille
Created April 28, 2012 14:21
Show Gist options
  • Save pazguille/2519409 to your computer and use it in GitHub Desktop.
Save pazguille/2519409 to your computer and use it in GitHub Desktop.
Countdown days
var countDown = function (finalDate) {
var final = new Date(finalDate),
today = new Date(),
diff = final.getTime() - today.getTime(),
days = Math.floor(diff / (1000 * 60 * 60 * 24)),
segs = Math.floor(diff / 1000);
return days;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment