-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDigitalclock.html
More file actions
49 lines (42 loc) · 1.02 KB
/
Digitalclock.html
File metadata and controls
49 lines (42 loc) · 1.02 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Digital Clock</title>
<style>
body{
background-color: black;
font-family: 'Times New Roman', Times, serif;
color: white;
text-align: center;
}
.clock{
height:120px;
width:300px;
border: 1px solid white;
background-color: white;
border-radius: 8px;
color: black;
margin: 0 auto;
margin-top: 100px;
text-align: center;
font-size: 20px;
font-weight: 500;
}
</style>
</head>
<body>
<div class="center">
<h1>This is Local Time</h1>
<div class="clock"></div>
</div>
<script>
let clock = document.querySelector(".clock");
setInterval(function(){
let date = new Date();
clock.innerHTML = date.toLocaleTimeString();
},1000);
</script>
</body>
</html>