定时1S刷新系统时间,当日、时、分、秒,不足2位时补0
//时间更新
function timeUpdate() {
var date=new Date();
var year=date.getFullYear();
var month=date.getMonth()+1;
var day=date.getDate();
var hour="00"+date.getHours();
hour=hour.substr(hour.length-2);
var minute="00"+date.getMinutes();
minute=minute.substr(minute.length-2);
var second="00"+date.getSeconds();
second=second.substr(second.length-2);
$("#foot_time").html(year+"-"+month+"-"+day+" "+" "+hour+":"+minute+":"+second);
setTimeout("timeUpdate()", 1000); //设置过1000毫秒就是1秒,调用show方法
}
timeUpdate() ;