Laravel 4.2 created_at 列给出 "The format separator does not match"错误

标签 laravel laravel-4 models

我试图访问我的一个模型中的 created_at 列,但出现以下错误:

The format separator does not match. The format separator does not match. The format separator does not match.

错误实际上重复了 3 次。

这是我尝试访问该列的方式:

$model->created_at

我的模型中没有将 $timestamps 设置为 false,我可以很好地访问其他列。

有什么问题?

最佳答案

您是否覆盖了模型中的 getDateFormat()

我上周遇到了这个问题。问题是日期时间格式。我有一个解释错误的链接。
https://github.com/laravel/framework/pull/4181

如果您重写了 getDateFormat(),请注释掉该函数并查看它是否有效。

如果不是,请确保数据库中的日期时间格式不古怪。

关于Laravel 4.2 created_at 列给出 "The format separator does not match"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26846440/

相关文章:

php - Laravel 聊天中的长轮询 : Why is the div not updating itself?

magento 访客日志

php - 找不到 Laravel 5 类,使用命名空间

php - Laravel - 从模型中操作数据

laravel - 在我的 Blade View 中使用 @if(Auth::user()) 与 @auth 相同吗?

join - Laravel 4 Eloquent Query Builder - 复杂的变量连接

laravel - 将 laravel 5.1 升级到 5.2\App::environment() 后始终返回 "production"

css - 在 Laravel 4 中加载响应式 CSS

silverlight - 实体命名空间未出现在 Silverlight 项目中