const seconds = document.querySelector(".seconds .number"), minutes = document.querySelector(".minutes .number"), hours = document.querySelector(".hours .number"), days = document.querySelector(".days .number"); // Set launch date: 15 May 2025 at 00:00 IST const launchDateIST = new Date("2025-08-15T00:00:00+05:30"); const updateCountdown = () => { // Get current time in IST const nowUTC = new Date(); const nowIST = new Date(nowUTC.toLocaleString("en-US", { timeZone: "Asia/Kolkata" })); const timeDiff = launchDateIST - nowIST; if (timeDiff <= 0) { // Timer expired clearInterval(timer); seconds.textContent = "00"; minutes.textContent = "00"; hours.textContent = "00"; days.textContent = "00"; return; } // Time calculations const totalSeconds = Math.floor(timeDiff / 1000); const d = Math.floor(totalSeconds / (60 * 60 * 24)); const h = Math.floor((totalSeconds % (60 * 60 * 24)) / (60 * 60)); const m = Math.floor((totalSeconds % (60 * 60)) / 60); const s = totalSeconds % 60; // Display values with leading zero days.textContent = d < 10 ? `0${d}` : d; hours.textContent = h < 10 ? `0${h}` : h; minutes.textContent = m < 10 ? `0${m}` : m; seconds.textContent = s < 10 ? `0${s}` : s; }; const timer = setInterval(updateCountdown, 1000); updateCountdown(); // Initial call