Skip to content

Commit f1e6903

Browse files
Add files via upload
0 parents  commit f1e6903

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

index.html

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Time</title>
7+
<style>
8+
html, body{
9+
margin: 0;
10+
padding: 0;
11+
background-color: black;
12+
overflow: hidden;
13+
font-family: 'Inter';
14+
color: white;
15+
}
16+
.center{
17+
padding: 1em;
18+
line-height: 0;
19+
margin: 10px;
20+
border: 5px solid white;
21+
border-radius: 20px;
22+
}
23+
#Time{
24+
color: white;
25+
font-family: 'Inter';
26+
font-size: 15vw;
27+
}
28+
#utctime{
29+
color: white;
30+
font-family: 'Inter';
31+
font-size: 15vw;
32+
}
33+
main{
34+
display: flex;
35+
height: 100vh;
36+
align-items: center;
37+
justify-content: center;
38+
}
39+
.title{
40+
padding: 1em;
41+
border-radius: 10px;
42+
background-color: #444444;
43+
width: fit-content;
44+
}
45+
</style>
46+
</head>
47+
<body>
48+
49+
<main>
50+
<div class="center">
51+
<h1 id="Time">IST</h1>
52+
</div>
53+
<div class="center">
54+
<h1 id="utctime">UTC</h1>
55+
</div>
56+
</main>
57+
58+
<script>
59+
setInterval(() => {
60+
const a = new Date()
61+
let hours = a.getHours()
62+
let mins = a.getMinutes()
63+
64+
if(hours.toString().length<2){
65+
hours = '0'+hours
66+
}
67+
if(mins.toString().length<2){
68+
mins = '0'+mins
69+
}
70+
const html = `${hours}:${mins}`
71+
document.getElementById('Time').innerText = html
72+
}, 1000);
73+
74+
75+
76+
setInterval(() => {
77+
const b = new Date()
78+
let utchours = b.getUTCHours()
79+
let utcmins = b.getUTCMinutes()
80+
81+
if(utchours.toString().length<2){
82+
utchours = '0'+utchours
83+
}
84+
if(utcmins.toString().length<2){
85+
utcmins = '0'+utcmins
86+
}
87+
const html = `${utchours}:${utcmins}`
88+
document.getElementById('utctime').innerText = html
89+
}, 2000);
90+
</script>
91+
</body>
92+
</html>

0 commit comments

Comments
 (0)