Advertisement
countrymac1977

Test

Apr 2nd, 2021 (edited)
541
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var countDownDate = new Date('Sep 25, 2025 15:00:00').getTime();
  2.  
  3. // Get todays date and time
  4. var now = new Date().getTime();
  5.  
  6. // Find the distance between now an the count down date
  7. var distance = countDownDate - now;
  8.  
  9. // Time calculations for days, hours, minutes and seconds
  10. var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  11. var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  12. var seconds = Math.floor((distance % (1000 * 60)) / 1000);
  13.  
  14. // Output result
  15. var output = hours + "h " + minutes + "m " + seconds + "s ";
  16.  
  17. output;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement