-
Notifications
You must be signed in to change notification settings - Fork 3
/
script.js
52 lines (37 loc) · 1.37 KB
/
script.js
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
var time = document.getElementsByTagName("p")[0];
var time_1 = document.getElementsByTagName("p")[1];
var time_2 = document.getElementsByTagName("p")[2];
var time_3 = document.getElementsByTagName("p")[3];
var time_4 = document.getElementsByTagName("p")[4];
var time_5 = document.getElementsByTagName("p")[5];
var time_6 = document.getElementsByTagName("p")[6];
var date_1 = document.getElementsByTagName("h6")[0];
var date_2 = document.getElementsByTagName("h6")[1];
var date_3 = document.getElementsByTagName("h6")[2];
var date_4 = document.getElementsByTagName("h6")[3];
var date_5 = document.getElementsByTagName("h6")[4];
setInterval(handler, 1)
function handler() {
var date = new Date();
var hour = date.getHours();
var mint = date.getMinutes();
var sec = date.getSeconds();
var mysec = date.getMilliseconds();
time.innerHTML = `${hour}`
time_1.innerHTML = ":"
time_2.innerHTML = `${mint}`
time_3.innerHTML = ":"
time_4.innerHTML = `${sec}`
time_5.innerHTML = ":"
time_6.innerHTML = `${mysec}`
time_6.style.width = "20%"
var month = date.getMonth();
var day = date.getDate();
var year = date.getFullYear();
date_1.innerHTML = `${month}`
date_2.innerHTML = ":"
date_3.innerHTML = `${day}`
date_4.innerHTML=":"
date_5.innerHTML=`${year}`
}
var ary