I created an application and all the db tables have ‘created,modified’ fields that filled automatically by Cakephp’s Default Functionality.
And I put the Field Type is
created datetime NULL,
modified datetime NULL,
like.
But it doesn’t work. The data where shows 0000-00-00 00:00:00 Format.
The cakephp version is 1.2 , so i put the datetime NULL option ,also I removed the temp,cache files in Model.
I need to save the correct date & time format for those 2 fields.
If there is any problem with XAMPP version (I use the latest version of XAMPP,1.7.7 PHP: 5.3.8 & mysql v 5.5.16 )
I hope that all are identifies my Issue.
Please help me with correct solution.
I had a similar issue but in CakePHP 2.1.3 with the created and modified columns inserting a bunch of zeros instead of the current datetime.
My problem was the existing cache of the relevant model. I had to delete the existing model cache to make this automatic datetime stuff work. The cache be found in: app/tmp/cache/models/.
I think I had this problem in the first place because I altered the structure of the table after its initial creation, adding the created field.
After deleting the model cache once, it was was working fine.