Home:ALL Converter>Javascript check difference in days between dates

Javascript check difference in days between dates

Ask Time:2016-01-23T12:05:36         Author:user2028856

Json Formatter

I have two date variables that I'd like to compare the difference in days or hours:

var old_date    = 20160120030136;
var new_date    = 20160123190443;

My question is, how do I check using JS/jQuery the difference in days or hours between new_date and old_date?

Author:user2028856,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/34959493/javascript-check-difference-in-days-between-dates
yy