代码:
<
SCRIPT
>
function Refresh() {
Time.innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());
setTimeout("Refresh()",1000);
}
var timer = setTimeout( " Refresh() " , 1000 );
</ SCRIPT >
< DIV style = " background-color:#eeeeee " id = " Time " ></ DIV >
function Refresh() {
Time.innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());
setTimeout("Refresh()",1000);
}
var timer = setTimeout( " Refresh() " , 1000 );
</ SCRIPT >
< DIV style = " background-color:#eeeeee " id = " Time " ></ DIV >
本文转自博客园执着的笨蛋的博客,原文链接:js获取 日期 星期 时间
,如需转载请自行联系原博主。