' Le date possono essere facilmente confrontate.
' L'esempio seguente confronta la data odierna con il 14 gennaio 2100: https://www.w3schools.com/js/tryit.asp?filename=tryjs_date_compare <!DOCTYPE html> <html> <body> <p id="demo"></p> <script> var today, someday, text; today = new Date(); someday = new Date(); someday.setFullYear(2100, 0, 14); if (someday > today) { text = "Today is before January 14, 2100."; } else { text = "Today is after January 14, 2100."; } document.getElementById("demo").innerHTML = text; </script> </body> </html> |