const startTimestamp = //起始时间戳
const endTimestamp = //结束时间戳
const timestampPerDay = 1000 * 60 * 60 * 24; // 一天的毫秒数
const dayCount = Math.floor((endTimestamp - startTimestamp) / timestampPerDay) + 1;
const timestamps = [];
for (let i = 0; i < dayCount; i++) {
const currentTimestamp = startTimestamp + i * timestampPerDay;
timestamps.push(currentTimestamp);
}
console.log(timestamps);
js把两个区间的时间戳进行拆解
最新推荐文章于 2024-10-01 20:12:28 发布