当天0点时间戳
new Date(new Date().toLocaleDateString()).getTime()
7天前
const start = new Date(new Date().toLocaleDateString());
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
const t = start.getTime();
console.log(start)
console.log(t)
当天0点时间戳
new Date(new Date().toLocaleDateString()).getTime()
7天前
const start = new Date(new Date().toLocaleDateString());
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
const t = start.getTime();
console.log(start)
console.log(t)
本文标题:JS 获取当天零点时间戳
本文链接:https://www.haomeiwen.com/subject/cmtlmqtx.html
网友评论