Skip to content

Instantly share code, notes, and snippets.

@mshuffett
Created April 16, 2024 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mshuffett/5ebf9e95e6e796d753e1dcccb694b473 to your computer and use it in GitHub Desktop.
Save mshuffett/5ebf9e95e6e796d753e1dcccb694b473 to your computer and use it in GitHub Desktop.
Plain Clock
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Clock</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #282c34;
color: white;
font-family: Arial, sans-serif;
font-size: 48px;
}
</style>
</head>
<body>
<div id="clock"></div>
<script>
function updateTime() {
const now = new Date();
document.getElementById('clock').textContent = now.toLocaleTimeString();
}
setInterval(updateTime, 1000);
updateTime();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment