-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
61 lines (50 loc) · 1.32 KB
/
index.html
File metadata and controls
61 lines (50 loc) · 1.32 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>coundown (bykunal)</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<table class="container" cellpadding="5px">
<tr class="info">
<td id="days"></td>
<td id="hrs"></td>
<td id="min"></td>
<td id="sec"></td>
</tr>
<tr>
<td>days</td>
<td>hours</td>
<td>minutes</td>
<td>seconds</td>
</tr>
</table>
<script type="text/javascript">
function countDown()
{
var today = new Date();
var eventDate = new Date("January 1 ,2020 00:00:00");
var currentTime = today.getTime();
var eventTime = eventDate.getTime();
var remTime = eventTime - currentTime;
var sec = Math.floor(remTime/1000);
var min = Math.floor(sec/60);
var hrs = Math.floor(min/60);
var days = Math.floor(hrs/24);
hrs = hrs % 24;
min%= 60;
sec%= 60;
hrs = (hrs<10) ? "0"+hrs : hrs;
min = (min<10) ? "0"+min : min;
sec = (sec<10) ? "0"+sec : sec;
document.getElementById("days").innerHTML =days;
document.getElementById("hrs").innerHTML =":"+hrs;
document.getElementById("min").innerHTML =":"+min;
document.getElementById("sec").innerHTML =":"+sec;
setTimeout(countDown,1000);
}
countDown();
</script>
</body>
</html>