I need your help,
How can one compare the difference between two given dates while using the US date standard of mm/dd/yyyy?
A few examples below:
11/20/2014 minus 11/25/2014 = -5
11/25/2014 minus 11/25/2014 = 0
11/27/2014 minus 11/25/2014 = 2
I need your help,
How can one compare the difference between two given dates while using the US date standard of mm/dd/yyyy?
A few examples below:
11/20/2014 minus 11/25/2014 = -5
11/25/2014 minus 11/25/2014 = 0
11/27/2014 minus 11/25/2014 = 2
var date1 = new Date("11/20/2014");
var date2 = new Date("11/25/2014");
var timeDiff = Math.abs(date2.getTime() - date1.getTime());
var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
try this