Script code for specific time zone
you have to enter the following script to display a specific time
<!--HERO DIGITAL CLOCK GSAP-->
<script>
const hourEl = document.querySelector('.hour');
const minuteEl = document.querySelector('.minute');
const colonEl = document.querySelector('.colon');
// 🕐 Update the time
function updateTime() {
const now = new Date();
let hours = now.getHours();
let minutes = now.getMinutes();
// Convert to 12-hour format (optional)
// hours = hours % 12 || 12;
hourEl.textContent = String(hours).padStart(2, "0");
minuteEl.textContent = String(minutes).padStart(2, "0");
}
updateTime();
setInterval(updateTime, 1000 * 10); // refresh every 10s
// 💡 GSAP blinking colon
gsap.to(colonEl, {
opacity: 0,
duration: 0.6,
ease: "power1.inOut",
repeat: -1,
yoyo: true
});
</script>
<!--END HERO DIGITAL CLOCK GSAP-->