setInterval(function(){
var timestamp1 = new Date('2019-04-30 07:54:00') //自己设定的时间
var timestamp2 = new Date() //电脑系统实际时间
if(timestamp1 - timestamp2 > 0){
console.log('还没有过时间!');
}else{
console.log('已经超过时间了!');
}
},1000);
利用时间戳判断来搞事情
最新推荐文章于 2024-07-01 03:14:24 发布