Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function updateClock() {
- let now = new Date();
- let milli = now.getMilliseconds();
- let sec = now.getSeconds();
- let min = now.getMinutes();
- let hr = now.getHours();
- let mm = now.getMonth();
- let dy = now.getDate();
- let yyyy = now.getFullYear();
- // console.log(`${dy}:${mm}:${yyyy}:${hr}:${mm}:${sec}:${milli}:`)
- document.body.style.background = "white";
- document.body.innerHTML = `<h1>${dy}:${mm}:${yyyy}:${hr}:${mm}:${sec}:${milli}</h1>`
- }
- function initialClock() {
- updateClock();
- window.setInterval(updateClock, 1)
- }
- initialClock();
Add Comment
Please, Sign In to add comment