Days between two dates in Javascript

javascript

To quickly find the number of days between two dates, you can type this in the JS console

((new Date("2012-02-04") - new Date("2012-02-03")) / 24 / 3600000) >> 0

//or, for the difference between a date and today
((new Date() - new Date("2013-03-31")) / 24 / 3600000) >> 0