util.TowTimeDayFormat = function (time1, time2) { let totalDays,diffDate var day1 = Date.parse(time1) var day2 = Date.parse(time2) // 将两个日期都转换为毫秒格式,然后做差 diffDate = Math.abs(day1 - day2) // 取相差毫秒数的绝对值 totalDays = Math.floor(diffDate / (1000 * 3600 * 24)) // 向下取整 return totalDays // 相差的天数 },
标签:totalDays,相差,天数,js,var,diffDate,Math From: https://www.cnblogs.com/yn-cn/p/17071906.html