Validating Date of Birth format from a form field value I'm working a on website project which includes a web form which asks for various personal details, one of the fields on the form is Date of Birth.

The form is being validated by a custom plugin which is using models for validation.

Currently the AttributeType for the Date Of Birth field is defined as AttributeType::DateTime, so bad values just get removed during POST, however it would be nice to try and catch values that fail a date format validation of dd/MM/yyyy so the user can correct it, otherwise the field value will simply be discarded and user will be unaware of this.

What is best way to check and catch that the Date Of Birth field value isn't in the required format? I want avoid any regex related parsing as I'm sure there are better ways to examine the format using other PHP date related functions.
Would it be worth doing some client-side validation first using javascript to check the date of birth field is entered correctly? You can use an onChange event on your field and then split the string on "/" and check each part is within a valid range 0-31, 1-12, 1900-2016.

For serverside checking, you can use strtotime() and check that the return isn't false.