-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
92 lines (85 loc) · 2.33 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Time</title>
<style>
html, body{
margin: 0;
padding: 0;
background-color: black;
overflow: hidden;
font-family: 'Inter';
color: white;
}
.center{
padding: 1em;
line-height: 0;
margin: 10px;
border: 5px solid white;
border-radius: 20px;
}
#Time{
color: white;
font-family: 'Inter';
font-size: 15vw;
}
#utctime{
color: white;
font-family: 'Inter';
font-size: 15vw;
}
main{
display: flex;
height: 100vh;
align-items: center;
justify-content: center;
}
.title{
padding: 1em;
border-radius: 10px;
background-color: #444444;
width: fit-content;
}
</style>
</head>
<body>
<main>
<div class="center">
<h1 id="Time">IST</h1>
</div>
<div class="center">
<h1 id="utctime">UTC</h1>
</div>
</main>
<script>
setInterval(() => {
const a = new Date()
let hours = a.getHours()
let mins = a.getMinutes()
if(hours.toString().length<2){
hours = '0'+hours
}
if(mins.toString().length<2){
mins = '0'+mins
}
const html = `${hours}:${mins}`
document.getElementById('Time').innerText = html
}, 1000);
setInterval(() => {
const b = new Date()
let utchours = b.getUTCHours()
let utcmins = b.getUTCMinutes()
if(utchours.toString().length<2){
utchours = '0'+utchours
}
if(utcmins.toString().length<2){
utcmins = '0'+utcmins
}
const html = `${utchours}:${utcmins}`
document.getElementById('utctime').innerText = html
}, 2000);
</script>
</body>
</html>