-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
61 lines (50 loc) · 1.46 KB
/
index.html
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>
<title>Clock</title>
<style>
body {
background: #060608;
}
.time {
color: #2470a0;
font-size: 5em;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
text-align: center;
}
.date {
color: #2470a0;
font-size: 2em;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
text-align: center;
}
.centre {
margin: 0;
position: absolute;
top: 50%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
</style>
<meta charset="UTF-8">
</head>
<body>
<div class="centre">
<div id="time-display" class="time" onload="showTime()"></div>
<div id="date-display" class="date"></div>
</div>
<script>
function showTime() {
var d = new Date();
var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
time = d.toLocaleTimeString('en-NZ', { hour12: true });
date = d.toLocaleDateString('en-NZ', options);
document.getElementById("time-display").innerText = time.toUpperCase();
document.getElementById("date-display").innerText = date;
setTimeout(showTime, 1000);
}
showTime();
</script>
</body>
</html>