function CalculateDate() { var startDate = "01/10/1429"; var endDate = "04/23/1436"; var sdt = new Date(startDate); var edt = new Date(endDate); var difdt = new Date(edt - sdt); const diffTime = Math.abs(sdt - edt); const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)); TotalDays.SetText(diffDays + " Total Days"); <-- total days are more than actual calendar days alert((difdt.toISOString().slice(0, 4) - 1970) + "Y " + (difdt.getMonth()) + "M " + (difdt.getDate() - 1) + "D"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)