create_time
will be zero filled when you save the model after loading it and afterFind() changed the value of create_time
to a formatted date.
This is because when you save your model now your are trying to send the formatted value to the database which does not understand the format and set the value to 0000-00-00 00:00:00
.
When you implement an afterFind()
method to change values format, you have to implement a beforeSave()
method to set the value back to a format that can be understood by the database.
It is generally a bad idea to format values directly on the model. When you are doing strict MVC it is the job of the View to format your Date correctly.