var countDownDate1 = new Date("Jun 11, 2025 00:00:00").getTime(); var countDownDate2 = new Date("Jun 11, 2025 00:00:00").getTime(); var countDownDate3 = new Date("Jun 11, 2025 00:00:00").getTime(); var countDownDate4 = new Date("Jun 18, 2025 00:00:00").getTime(); // Update the count down every 1 second var x = setInterval(function() { // Get todays date and time var now = new Date().getTime(); // Find the distance between now an the count down date var distance1 = countDownDate1 - now; var distance2 = countDownDate2 - now; var distance3 = countDownDate3 - now; var distance4 = countDownDate4 - now; // Time calculations for days, hours, minutes and seconds var days1 = Math.floor(distance1 / (1000 * 60 * 60 * 24)); var hours1 = Math.floor((distance1 % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes1 = Math.floor((distance1 % (1000 * 60 * 60)) / (1000 * 60)); var seconds1 = Math.floor((distance1 % (1000 * 60)) / 1000); var days2 = Math.floor(distance2 / (1000 * 60 * 60 * 24)); var hours2 = Math.floor((distance2 % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes2 = Math.floor((distance2 % (1000 * 60 * 60)) / (1000 * 60)); var seconds2 = Math.floor((distance2 % (1000 * 60)) / 1000); var days3 = Math.floor(distance3 / (1000 * 60 * 60 * 24)); var hours3 = Math.floor((distance3 % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes3 = Math.floor((distance3 % (1000 * 60 * 60)) / (1000 * 60)); var seconds3 = Math.floor((distance3 % (1000 * 60)) / 1000); var days4 = Math.floor(distance4 / (1000 * 60 * 60 * 24)); var hours4 = Math.floor((distance4 % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes4 = Math.floor((distance4 % (1000 * 60 * 60)) / (1000 * 60)); var seconds4 = Math.floor((distance4 % (1000 * 60)) / 1000); // Display the result in the element with id="time" document.getElementById("time1").innerHTML = days1 + "g " + hours1 + "h " + minutes1 + "m " + seconds1 + "s "; document.getElementById("time2").innerHTML = days2 + "g " + hours2 + "h " + minutes2 + "m " + seconds2 + "s "; document.getElementById("time3").innerHTML = days3 + "g " + hours3 + "h " + minutes3 + "m " + seconds3 + "s "; document.getElementById("time4").innerHTML = days4 + "g " + hours4 + "h " + minutes4 + "m " + seconds4 + "s "; // If the count down is finished, write some text if (distance1 < 0) { clearInterval(x); document.getElementById("time1").innerHTML = "Corso Iniziato"; } if (distance2 < 0) { clearInterval(x); document.getElementById("time2").innerHTML = "Corso Iniziato"; } if (distance3 < 0) { clearInterval(x); document.getElementById("time3").innerHTML = "Corso Iniziato"; } if (distance4 < 0) { clearInterval(x); document.getElementById("time4").innerHTML = "Corso Iniziato"; } }, 1000);