-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path代码1.html
67 lines (34 loc) · 1.83 KB
/
代码1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<script>
function showTime() {
var date = new Date();
var Year=date.getFullYear();
var Month=date.getMonth()+1;
var Dates=date.getDate();
var week = date.getDay();
var Hour=date.getHours();
if(Hour<10){
Hour='0'+Hour;
}else{
Hour=Hour;
}
var Minute=date.getMinutes();
if(Minute<10){
Minute='0'+Minute;
}else{
Minute=Minute;
}
var Second=date.getSeconds();
if(Second<10){
Second='0'+Second;
}else{
Second=Second;
}
var weeks = ["日","一","二","三","四","五","六"];
var getWeek = "星期" + weeks[week];
document.getElementById('datetime').innerHTML="现在是:" + Year +"年" + Month + "月" + Dates +"日"+" "+ getWeek+" "+ Hour+ ":"+ Minute + ":" + Second;
setTimeout('showTime()',1000);
}
</script>
<body onload="showTime()">
<div id="datetime"></div>
</body>