-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcounttimer.js
More file actions
22 lines (17 loc) · 823 Bytes
/
counttimer.js
File metadata and controls
22 lines (17 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const second = 0//1000,
minute = 0//second * 60,
hour = 0//minute * 60,
let countDown = new Date('Sep 28, 2019 00:00:00').getTime(),
x = setInterval(function() {
let now = new Date().getTime(),
distance = 0 // countDown - now;
document.getElementById('hours').innerText = 0//Math.floor((distance % (day)) / (hour)),
document.getElementById('minutes').innerText = 0 //Math.floor((distance % (hour)) / (minute)),
document.getElementById('seconds').innerText = 0//Math.floor((distance % (minute)) / second),
document.getElementById('days').innerText = 0//Math.floor(distance / (day)),
//do something later when date is reached
//if (distance < 0) {
// clearInterval(x);
// 'IT'S MY BIRTHDAY!;
//}
}, second)