Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <p><b>Co:</b> PUZ-IO - Red Sky at Night <b>Kiedy:</b> 02/23/2020, 01:15:35
  2.  
  3.            
  4.             :::: <font size="3" color="red"> <i id="demo"></i></font></p>
  5.             <script>
  6.             // Set the date we're counting down to
  7.             var countDownDate = new Date("02/23/2020, 01:15:35").getTime();
  8.  
  9.             // Update the count down every 1 second
  10.             var x = setInterval(function() {
  11.  
  12.             // Get today's date and time
  13.             var now = new Date().getTime();
  14.  
  15.             // Find the distance between now and the count down date
  16.             var distance = countDownDate - now;
  17.  
  18.             // Time calculations for days, hours, minutes and seconds
  19.             var days = Math.floor(distance / (1000 * 60 * 60 * 24));
  20.             var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  21.             var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  22.             var seconds = Math.floor((distance % (1000 * 60)) / 1000);
  23.  
  24.             // Display the result in the element with id="demo"
  25.             document.getElementById("demo").innerHTML = days + "d " + hours + "h "
  26.             + minutes + "m " + seconds + "s ";
  27.  
  28.             // If the count down is finished, write some text
  29.             if (distance < 0) {
  30.             clearInterval(x);
  31.             document.getElementById("demo").innerHTML = "EXPIRED";
  32.             }
  33.             }, 1000);
  34.             </script>
  35.            
  36.         </p>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement