ANTICHAT

ANTICHAT (https://forum.antichat.xyz/index.php)
-   PHP (https://forum.antichat.xyz/forumdisplay.php?f=37)
-   -   Timer (https://forum.antichat.xyz/showthread.php?t=1349508)

sanders 14.02.2020 21:53

Обычный таймер обратного отсчета, может кому нужно

HTML:





Код:


var countDownDate = new Date("May 22, 2023 17:57:25").getTime();
var x = setInterval(function() {
    var now = new Date().getTime();
    var distance = countDownDate - now;
    var days = Math.floor(distance / (1000 * 60 * 60 * 24));
    var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
    var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
    var seconds = Math.floor((distance % (1000 * 60)) / 1000);
    document.getElementById("demo").innerHTML = days + "days " + hours + "hours "
    + minutes + "minutes " + seconds + "seconds ";
    if (distance



Выглядит примерно так

https://forum.antichat.xyz/attachments/27459906/


Время: 00:20