function Time(){ var NowTime = new Date(); var ntime=NowTime.getFullYear()+‘/‘+(NowTime.getMonth()+1)+‘/‘+NowTime.getDate() var ntime2=NowTime.getFullYear()+‘/‘+(NowTime.getMonth()+1)+‘/‘+(NowTime.getDate()+1) var EndTime= new Date(ntime+ ‘ 9:30:00‘); var EndTime2= new Date(ntime+ ‘ 13:30:00‘); var EndTime3= new Date(ntime2+ ‘ 9:30:00‘); cha1=EndTime.getTime() - NowTime.getTime(); cha2=EndTime2.getTime() - NowTime.getTime(); cha3=EndTime3.getTime() - NowTime.getTime(); if(cha1>0){ t=cha1 } if(cha1<=0&&cha2>0){ t=cha2 } if(cha2<=0&&cha3>0){ t=cha3 } var d=Math.floor(t/1000/60/60/24); var h=Math.floor(t/1000/60/60%24); var m=Math.floor(t/1000/60%60); var s=Math.floor(t/1000%60); document.getElementById("pro_djs").innerHTML="倒计时"+h +"时"+m +"分"+s +"秒"; } setInterval(Time,1000);
时间: 2024-10-24 04:18:37