计算时间间隔具体每一天
计算时间间隔,中间的每一天。
function getDaysBetween(dateString1, dateString2) { var startDate = Date.parse(dateString1); var endDate = Date.parse(dateString2); while (startDate < endDate) { startDate = startDate + 1 * 24 * 60 * 60 * 1000; console.log(new Date(startDate)); } } getDaysBetween("2021-02-20", "2021-03-02")
本文来自博客园,作者:云霄紫潭,转载请注明原文链接:https://www.cnblogs.com/0520euv/p/14452117.html