问题
I am trying to access the created_at column in one of my models and I get the following error:
The format separator does not match. The format separator does not match. The format separator does not match.
The error actually repeats 3 times.
This is how I try to access the column:
$model->created_at
I do not have $timestamps set to false in my model and I can access the other columns just fine.
What is the problem?
回答1:
Did you override the getDateFormat() in your model?
I ran into this problem last week. The problem is the datetime format. I have a link that explains the error.
https://github.com/laravel/framework/pull/4181
If you have overridden the getDateFormat(), comment out the function and see if it works.
If not, make sure the datetime format in your database is not funky.
来源:https://stackoverflow.com/questions/26846440/laravel-4-2-created-at-column-gives-the-format-separator-does-not-match-error