bluvertigo
2/20/2017 - 8:39 AM

DateDiff - Differenza tra date

DateDiff - Differenza tra date

var date1 = new Date("2/1/2016"); // Mese, Giorno, Anno
var today = new Date("1/1/2016");
var timeDiff = today.getTime() - date1.getTime();
var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24)); 
document.write(diffDays);