Add Digital Clock supporting multiple time zones
Author: roydreams12Created Nov 21, 2025Updated Nov 21, 2025
Feature Request: Digital Clock in Multiple Time Zones
Overview: Implement a digital clock component that displays the current time for multiple, user-configurable time zones (e.g., New York, London, Berlin, Delhi, Tokyo, Sydney).
Details:
- Render clock times for a configurable list of time zones.
- Modern UI with a styled container, time zone labels, and clear time display.
- Responsive design suitable for portfolio page layout.
- Time zones can be modified easily in code.
- Accurate real-time update (refresh every second).
Reference Implementation:
<!-- Example implementation for reference -->
<div class="container">
<h2>Digital Clock<br/><span style="font-size: 18px; color: #90cdf4;">in Multiple Time Zones</span></h2>
<ul class="clock-list" id="clock-list"></ul>
</div>
<script>
// Add or remove time zones as needed
const TIME_ZONES = [
{ label: "New York (EST)", timeZone: "America/New_York" },
{ label: "London (GMT)", timeZone: "Europe/London" },
{ label: "Berlin (CET)", timeZone: "Europe/Berlin" },
{ label: "Delhi (IST)", timeZone: "Asia/Kolkata" },
{ label: "Tokyo (JST)", timeZone: "Asia/Tokyo" },
{ label: "Sydney (AEDT)", timeZone: "Australia/Sydney" },
];
function updateClocks() {
const clockList = document.getElementById("clock-list");
clockList.innerHTML = "";
TIME_ZONES.forEach(tz => {
const now = new Date();
const timeString = now.toLocaleTimeString('en-US', {
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
hour12: false,
timeZone: tz.timeZone
});
const listItem = document.createElement("li");
listItem.innerHTML = `<span class="tz-label">${tz.label}</span>${timeString}`;
clockList.appendChild(listItem);
});
}
updateClocks();
setInterval(updateClocks, 1000);
</script>Styling: Use modern CSS for layout. For example:
body {
font-family: 'Segoe UI', Arial, sans-serif;
background: #20232a;
color: #fff;
margin: 0;
padding: 0;
}
.container {
max-width: 480px;
margin: 50px auto;
background: #282c34;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.3);
padding: 30px;
text-align: center;
}
h2 {
font-size: 26px;
margin-bottom: 28px;
letter-spacing: 1px;
}
.clock-list {
list-style: none;
padding: 0;
}
.clock-list li {
margin: 18px 0;
font-size: 22px;
letter-spacing: 2px;
font-weight: 500;
background: #21252b;
border-radius: 5px;
padding: 14px;
box-shadow: 0 1px 5px rgba(0,0,0,0.2);
}
.tz-label {
color: #90cdf4;
font-size: 16px;
font-weight: 400;
display: block;
margin-bottom: 4px;
}Acceptance Criteria:
- Clock correctly displays current time for all configured zones
- UI matches modern portfolio styling
- Component is easy to configure and extend
- Code is modular and clean
This will provide visitors with real-time information for multiple regions, enhancing the global appeal of your portfolio.
Source: soumyajit4419/Portfolio