const countdown = document.querySelector('.clock'); // Set Launch Date (ms) const launchDate = new Date('Jan 1, 2019 13:00:00').getTime(); // Update every second const intvl = setInterval(() => { // Get todays date and time (ms) const now = new Date().getTime(); // Distance from now and the launch date (ms) const distance = launchDate - now; // Time calculation const days = Math.floor(distance / (1000 * 60 * 60 * 24)); const hours = Math.floor( (distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60) ); const mins = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); const seconds = Math.floor((distance % (1000 * 60)) / 1000); // Display result countdown.innerHTML = `