Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var countDownDate = new Date('Sep 25, 2025 15:00:00').getTime();
- // Get todays date and time
- var now = new Date().getTime();
- // Find the distance between now an the count down date
- var distance = countDownDate - now;
- // Time calculations for days, hours, minutes and seconds
- 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);
- // Output result
- var output = hours + "h " + minutes + "m " + seconds + "s ";
- output;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement