// 详细日期可忽略为 new Date("2021")
let endTime = new Date("2021/1/1 00:00:00").getTime()
let restTime = endTime - new Date().getTime()
day = Math.floor(restTime/1000/60/60/24);
hour = Math.floor(restTime/1000/60/60);
min = Math.floor(restTime/1000/60);
sec = Math.floor(restTime/1000);
网友评论