It does not check for leap years or invalid dates at the end of short months.
Syntactic validation should enforce correct syntax of structured fields (e.g.
If not, the input is compared to the regular expression.
The expressions use a pre-defined class is returned which enables the form to be submitted.
This routine DOES NOT check that the date or time input values are valid, just that they match the required format (d/m/y and h:m). Once you're in control of the input format, it's a lot easier to check that the values are actually valid.
The function has been improved now so that the day, month and year values are checked to ensure that they're in the right ball-bark (ie. Also the year must be between 1902 and the current year.