-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjs.js
More file actions
20 lines (17 loc) · 815 Bytes
/
js.js
File metadata and controls
20 lines (17 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function getTime(){
let now = new Date();
let hour = now.getHours();
let minute = now.getMinutes();
let second = now.getSeconds();
let day = now.getDate();
let month = now.getMonth()+1;
let year = now.getFullYear();
(hour<10) ? document.getElementById("hour").innerText = "0"+ hour
: document.getElementById("hour").innerText = hour;
(minute<10) ? document.getElementById("minute").innerText = "0"+ minute
: document.getElementById("minute").innerText = minute;
(second<10) ? document.getElementById("second").innerText = "0"+ second
: document.getElementById("second").innerText = second;
document.getElementById("date").innerText= day+ "/"+month+"/"+year;
}
setInterval(function(){getTime();}, 1000);