Lowest price ever! Learn Generative AI for 48% less!
Get my discount0
Rather than going to the trouble of validating a date, i often find its best (and simpler) to control the input. Take a look at input type = "date" in the html5 specification. Although the results will differ across browsers, it may give just what you want.