📜  jquery 计算日期时间差 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:56.887000             🧑  作者: Mango

代码示例1
// will return number of days
function calculateDT() {
            var oneD = 1000 * 60 * 60 * 24;
            var startDT = ($("#ETDsdt").val());
            var endDT = ($("#ETDedt").val());
            var sMS = new Date(startDT);
            var eMS = new Date(endDT);
            return Math.round((eMS.getTime() - sMS.getTime()) / oneD);
        }