I have designed a database with a field named creat_time. Its datatype is datetime. And when modifying the beforeSave I used date() function in php to generate data for a field. But when I check it failed (result is 0000-00-00 00:00:00 ). Can anyone tell me that I can used what function to generate this kind of data for datetime type field in MySql (PHP function).
↧