Hi,
I am using a MySQL database with PHP. I store my date values in the database using the DATETIME
field.
I'm using this PHP code to convert inputted dates to the appropriate format for MySQL.
date("Y-m-d H:i:s", strtotime($inputDate))
However, whenever a date is invalid, it is placed in the database as 1969-12-31 19:00:00
Is there a way to default this to 0000-00-00 00:00:00
?