Skip to content

Instantly share code, notes, and snippets.

@svandragt
Created August 25, 2025 09:21
Show Gist options
  • Save svandragt/f75995c55a8a8c1300583f881804d47d to your computer and use it in GitHub Desktop.
Save svandragt/f75995c55a8a8c1300583f881804d47d to your computer and use it in GitHub Desktop.
TabTime
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Time</title>
<style>
body {
font-family: sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
font-size: 3rem;
}
</style>
<script>
function updateTime() {
const now = new Date();
const hours = String(now.getHours()).padStart(2, '0');
const minutes = String(now.getMinutes()).padStart(2, '0');
const timeString = `Time ${hours}:${minutes}`;
document.title = timeString;
document.getElementById("time-display").textContent = timeString;
}
window.onload = () => {
updateTime();
setInterval(updateTime, 5000); // update every 5 seconds
};
</script>
</head>
<body>
<div id="time-display"></div>
</body>
</html>
@svandragt
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment