Countdown to October 31 function updateCountdown() { const now = new Date(); const currentYear = now.getFullYear(); const targetDate = new Date(`October 6, ${now.getMonth() === 9 && now.getDate() > 6 ? currentYear + 1 : currentYear} 00:00:00`); const totalSeconds = Math.floor((targetDate - now) / 1000); if (totalSeconds <= 0) { document.querySelector(".countdown").innerHTML = "🎃 Happy Halloween! 🎃
"; return; } const days = Math.floor(totalSeconds / (3600 * 24)); const hours = Math.floor((totalSeconds % (3600 * 24)) / 3600); const minutes = Math.floor((totalSeconds % 3600) / 60); const seconds = totalSeconds % 60; document.getElementById("days").textContent = String(days).padStart(2, "0"); document.getElementById("hours").textContent = String(hours).padStart(2, "0"); document.getElementById("minutes").textContent = String(minutes).padStart(2, "0"); document.getElementById("seconds").textContent = String(seconds).padStart(2, "0"); } updateCountdown(); setInterval(updateCountdown, 1000);
WEONDRUGS® 2025