function checktime(i){
return i<10 ? '0'+i :i;
}
show.innerHTML=year+"年"+month+"月"+date+"日"+weekday[day]+" "+hours+":"+checktime(minute)+":"+checktime(seconds)
return i<10 ? '0'+i :i;
}
show.innerHTML=year+"年"+month+"月"+date+"日"+weekday[day]+" "+hours+":"+checktime(minute)+":"+checktime(seconds)
2016-05-03
var weekday=new Array(7)
weekday[0]="星期日"
weekday[1]="星期一"
weekday[2]="星期二"
weekday[3]="星期三"
weekday[4]="星期四"
weekday[5]="星期五"
weekday[6]="星期六"
可以改成这样子: var weekday = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
weekday[0]="星期日"
weekday[1]="星期一"
weekday[2]="星期二"
weekday[3]="星期三"
weekday[4]="星期四"
weekday[5]="星期五"
weekday[6]="星期六"
可以改成这样子: var weekday = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
var day = now.getDay( ),
week = ["星期日 ","星期一 ","星期二 ","星期三 ","星期四 ","星期五 ","星期六 "],
weekend = week[day];
week = ["星期日 ","星期一 ","星期二 ","星期三 ","星期四 ","星期五 ","星期六 "],
weekend = week[day];
2016-04-30
最新回答 / 那些你很冒险的梦_
500毫秒的意思是500毫秒调用一次此函数,也就是说在一秒的时间里获取了两次当前时间并显示在页面上,两次时间完全相同无变化。所以setTimeout()中的时间只要在1000(单位为毫秒)内都可以。
2016-04-27