1
<script language="javascript">
2
function get_time()
3
{
4
var date=new Date();
5
var year="",month="",day="",week="",hour="",minute="",second="";
6
year=date.getYear();
7
month=add_zero(date.getMonth()+1);
8
day=add_zero(date.getDate());
9
week=date.getDay();
10
switch (date.getDay()) {
11
case 0:val="星期天";break
12
case 1:val="星期一";break
13
case 2:val="星期二";break
14
case 3:val="星期三";break
15
case 4:val="星期四";break
16
case 5:val="星期五";break
17
case 6:val="星期六";break
18
}
19
hour=add_zero(date.getHours());
20
minute=add_zero(date.getMinutes());
21
second=add_zero(date.getSeconds());
22
timetable.innerText=" "+year+"年"+month+"月"+day+"日 "+hour+":"+minute+":"+second+" "+val;
23
}
24![](/Images/OutliningIndicators/None.gif)
25
function add_zero(temp)
26
{
27
if(temp<10) return "0"+temp;
28
else return temp;
29
}
30
setInterval("get_time()",1000);
31
</script>
![](/Images/OutliningIndicators/None.gif)
2
![](/Images/OutliningIndicators/None.gif)
3
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
4
![](/Images/OutliningIndicators/InBlock.gif)
5
![](/Images/OutliningIndicators/InBlock.gif)
6
![](/Images/OutliningIndicators/InBlock.gif)
7
![](/Images/OutliningIndicators/InBlock.gif)
8
![](/Images/OutliningIndicators/InBlock.gif)
9
![](/Images/OutliningIndicators/InBlock.gif)
10
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
11
![](/Images/OutliningIndicators/InBlock.gif)
12
![](/Images/OutliningIndicators/InBlock.gif)
13
![](/Images/OutliningIndicators/InBlock.gif)
14
![](/Images/OutliningIndicators/InBlock.gif)
15
![](/Images/OutliningIndicators/InBlock.gif)
16
![](/Images/OutliningIndicators/InBlock.gif)
17
![](/Images/OutliningIndicators/InBlock.gif)
18
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
19
![](/Images/OutliningIndicators/InBlock.gif)
20
![](/Images/OutliningIndicators/InBlock.gif)
21
![](/Images/OutliningIndicators/InBlock.gif)
22
![](/Images/OutliningIndicators/InBlock.gif)
23
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
24
![](/Images/OutliningIndicators/None.gif)
25
![](/Images/OutliningIndicators/None.gif)
26
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
27
![](/Images/OutliningIndicators/InBlock.gif)
28
![](/Images/OutliningIndicators/InBlock.gif)
29
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
30
![](/Images/OutliningIndicators/None.gif)
31
![](/Images/OutliningIndicators/None.gif)
下面在调用时加上 id="timetable"如:<div style="margin-left:22px; margin-top:13px " class="top_txt" id="timetable"></div>