preg_match date time validation
While developing a custom module, I needed to validate the following date time format:
1987-11-22T23:52:12
The following code was used to create a pattern for the preg_match and to test the results. (Can be used as is.)