blob: 12f99ac0c9c3ff9f5a073dc3cab3613a2f7716fd (
plain)
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
|
<!DOCTYPE HTML>
<html>
<head>
<style>
p {
text-align: center;
font-size: 60px;
}
div {
font-family: "Courier";
text-align: center;
font-size: 60px;
color: #990000;
}
</style>
</head>
<body>
<div id="demo"></div>
<script>
var deadline = new Date("May 17, 2021 17:00:00").getTime();
var x = setInterval(function() {
var now = new Date().getTime();
var t = deadline - now;
if (t > 0) {
var days = Math.floor(t / (1000 * 60 * 60 * 24));
var hours = Math.floor((t%(1000 * 60 * 60 * 24))/(1000 * 60 * 60));
var minutes = Math.floor((t % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((t % (1000 * 60)) / 1000);
document.getElementById("demo").innerHTML
= ("00" + minutes).slice(-2) + ":" + ("00" + seconds).slice(-2);
} else {
document.getElementById("demo").innerHTML = "00:00";
}
}, 1000);
</script>
</body>
</html>
|