varcountDownDate=newDate("Dec 31, 2021 23:59:59").getTime();
varx=setInterval(function() {
varnow=newDate().getTime();
vardistance=countDownDate-now;
vardays=Math.floor(distance/ (1000*60*60*24));
varhours=Math.floor((distance% (1000*60*60*24)) / (1000*60*60));
varminutes=Math.floor((distance% (1000*60*60)) / (1000*60));
varseconds=Math.floor((distance% (1000*60)) /1000);
document.getElementById("countdown").innerHTML=days+" 天 "+hours+" 小时 "+minutes+" 分钟 "+seconds+" 秒 ";
if (distance<0) {
clearInterval(x);
document.getElementById("countdown").innerHTML="已过期";
}
}, 1000);