Tage
:
Stunden
:
Minuten
:
Sekunden
let countDownDate = new Date("Sept 19, 2021 15:00:00").getTime(); let x = setInterval(function () { let now = new Date().getTime(); let distance = countDownDate - now; let days = Math.floor(distance / (1000 * 60 * 60 * 24)); let daysStr = "0" + days.toString(); let hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); let hoursStr = "0" + hours.toString(); let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); let minutesStr = "0" + minutes.toString(); let seconds = Math.floor((distance % (1000 * 60)) / 1000); let secondsStr = "0" + seconds.toString(); document.getElementById("days-count").innerHTML = daysStr.substring(daysStr.length - 2, daysStr.length); document.getElementById("hours-count").innerHTML = hoursStr.substring(hoursStr.length - 2, hoursStr.length); document.getElementById("minutes-count").innerHTML = minutesStr.substring(minutesStr.length - 2, minutesStr.length); document.getElementById("seconds-count").innerHTML = secondsStr.substring(secondsStr.length - 2, secondsStr.length); if (distance < 0) { clearInterval(x); // document.getElementById("countdown-frame").classList.add('d-none'); // document.getElementsByClassName("home-items")[0].classList.add('d-block'); // document.getElementsByClassName("home-items")[0].classList.remove('d-none'); } }, 1000);