tell me how to catch the error
new DateTime('12')
Uncaught exception 'Exception' with message 'DateTime :: __ construct (): Failed to parse string php (1): DateTime -> __ construct ('12 ') # 1 {main} thrown on line 1
If the number is not correct, then set the default as new DAteTime(10-10-2010)