代码:
<
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
>
![](http://www.blogjava.net/Images/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://www.blogjava.net/Images/OutliningIndicators/ExpandedBlockStart.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://www.blogjava.net/Images/OutliningIndicators/InBlock.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://www.blogjava.net/Images/OutliningIndicators/InBlock.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://www.blogjava.net/Images/OutliningIndicators/ExpandedBlockEnd.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://www.blogjava.net/Images/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://www.blogjava.net/Images/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://www.blogjava.net/Images/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
本文转自博客园执着的笨蛋的博客,原文链接:js获取 日期 星期 时间
,如需转载请自行联系原博主。