SHARE
TWEET

Timer

DLERT Jul 12th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. var countDownDate = new Date("Jan 7, 2022 15:37:25").getTime();
  3.  
  4.  
  5. var x = setInterval(function() {
  6.  
  7.   var now = new Date().getTime();
  8.  
  9.   var distance = countDownDate - now;
  10.  
  11.   var days = Math.floor(distance / (1000 * 60 * 60 * 24));
  12.   var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  13.   var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  14.   var seconds = Math.floor((distance % (1000 * 60)) / 1000);
  15.  
  16.   document.getElementById("Timer").innerHTML = days + "d " + hours + "h "
  17.   + minutes + "m " + seconds + "s ";
  18.  
  19.   if (distance < 0) {
  20.     clearInterval(x);
  21.     document.getElementById("demo").innerHTML = "EXPIRED";
  22.   }
  23. }, 1000);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top