Thank you. I was unaware of this option. This helps.
But using this with the input of '1234/12/12' which is not a date if the format is m/d/y. The PHP function date_parse tries to parse this and comes up with the year as 'false' the month of 3 and a day of 12. Even here I need to apply a regular expression to make sure the date is at least close. Once I have verified that it is close then I could use date_parse to check for outlier cases like 'Feb. 31st'.
Also, if I return a string in the $errors array I get back to the original form (the input was rejected) but I don't see any indication of the error on the form like I would on addRule or addGroupRule. This seems to be a problem with using the validation in the Moodle form.
When I use DateTime::createFromFormat('m/d/Y', '2/31/2014') I get no exception but it formed a date 3/3/2014. So it seems rather than flagging it as an error it just adds the 3 invalid days to form the date. I would call this a PHP bug. But I am not going there.
So there doesn't seem to be a 'simple' validation answer. You?