Node.js examples for Date:Date Calculation
Get Interval between two date value
dateUtil.getInterval = function (date1, date2) { var difference = Date.UTC(date1.getYear(), date1.getMonth(), date1.getDate(), 0, 0, 0) - Date.UTC(date2.getYear(), date2.getMonth(), date2.getDate(), 0, 0, 0); var difdays = difference / (1000 * 60 * 60 * 24); return difdays; };