function currTimeForm(currTime){
var day = Math.floor(currTime/60/60/24);
var hour = Math.floor(currTime/60/60%24);
var min = Math.floor(currTime/60%60);
var sec = Math.floor(currTime%60);
if(day<10){
day = "0"+day;
}
if(hour<10){
hour = "0"+hour;
}
if(min<10){
min = "0"+min;
}
if(sec<10){
sec = "0"+sec;
}
return day+":"+hour+":"+min+":"+sec;
}
JavaScript倒计时。首先我们要设置倒计时时间格式,方法如下:function currTimeForm(currTime){ var day = Math.floor(currTime/60/60/24); var hour = Math.floor(currTime/60/60%24); var min = Math.floor(currTime/60%60)