Salve a tutti,
quello che ho bisogno se qualcuno puo aiutarmi, è di poter mettere nel codice di sotto riportato esattamente nella variabile countDownDate la data attuale piu 1 giorno, questo per automatizzare il countDown ad avere sempre un giorno in piu della scadenza, per data intendo solo giorno mese anno, mentre le ore i minuti e i secondi possono rimanere invariati.
codice HTML:<script> // The data/time we want to countdown to var countDownDate = new Date("Jul 25, 2021 12:30:00").getTime(); // Run myfunc every second var myfunc = setInterval(function() { var now = new Date().getTime(); var timeleft = countDownDate - now; // Calculating the days, hours, minutes and seconds left var days = Math.floor(timeleft / (1000 * 60 * 60 * 24)); var hours = Math.floor((timeleft % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((timeleft % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((timeleft % (1000 * 60)) / 1000); // Result is output to the specific element document.getElementById("days").innerHTML = days + ": " document.getElementById("hours").innerHTML = hours + ": " document.getElementById("mins").innerHTML = minutes + ": " document.getElementById("secs").innerHTML = seconds + "" // Display the message when countdown is over if (timeleft < 0) { clearInterval(myfunc); document.getElementById("days").innerHTML = "" document.getElementById("hours").innerHTML = "" document.getElementById("mins").innerHTML = "" document.getElementById("secs").innerHTML = "" document.getElementById("end").innerHTML = "SPIACENTE!"; } }, 1000); </script>

Rispondi quotando