Laravel 4.2 created_at column gives “The format separator does not match” error

一个人想着一个人 提交于 2019-12-23 21:33:23

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!