Skip to content

Commit

Permalink
Create clock.html
Browse files Browse the repository at this point in the history
  • Loading branch information
udontur authored Feb 5, 2024
1 parent fac7e27 commit 7b87e82
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions clock.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<title>Clock</title>
<style>
body {
background-color: #181818;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
font-size: 25em;
font-family: Arial, sans-serif;
color: white;
margin: 0;
font-weight: 600;
}
</style>
</head>
<body>
<script>
function updateClock() {
const now = new Date();
const hours = now.getHours().toString().padStart(2, "0");
const minutes = now.getMinutes().toString().padStart(2, "0");
const seconds = now.getSeconds().toString().padStart(2, "0");
document.body.textContent = `${hours}:${minutes}:${seconds}`;
}
updateClock();
setInterval(updateClock, 1000);
</script>
</body>
</html>

0 comments on commit 7b87e82

Please sign in to comment.