无效的日期时间格式:1292 不正确的日期时间值 - Laravel 5.4
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42743313/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Invalid datetime format: 1292 Incorrect datetime value - Laravel 5.4
提问by hightekjonathan
I did a fresh install of Laravel 5.4 using the official Laravel installer for Composer. I ran php artisan make:auth
to create the system for login/register. The login page works when I manually enter in the user in the database, but my register page gives me the following error:
我使用 Composer 的官方 Laravel 安装程序全新安装了 Laravel 5.4。我跑去php artisan make:auth
创建登录/注册系统。当我在数据库中手动输入用户时,登录页面有效,但我的注册页面出现以下错误:
SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2017-03-12 02:53:06' for column 'updated_at' at row 1
and
和
SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2017-03-12 02:53:06' for column 'updated_at' at row 1 (SQL: insert into `users` (`name`, `email`, `password`, `updated_at`, `created_at`) values (Jonathan Stowe, [email protected], y$ukSU8/YktI88igoHxhgjdeahZhFZinoR.8vCNMpjv9CjeQRe.izsq, 2017-03-12 02:53:06, 2017-03-12 02:53:06))
Im using PHP v7.1.1, MySQL v5.6.35, Larval 5.4.*
我使用 PHP v7.1.1、MySQL v5.6.35、Larval 5.4.*
Googling the error only showed info for custom made migrations, but not the default ones. Did I configure something wrong? Or is this a known error? I can supply any files needed.
谷歌搜索错误只显示定制迁移的信息,而不是默认的。我配置错了吗?或者这是一个已知错误?我可以提供任何需要的文件。
Thank you in advance!
先感谢您!
回答by Augwa
That time doesn't actually exist :) I'm assuming that you're timezone using something that is DST.
那个时间实际上并不存在:) 我假设您使用的是夏令时的时区。
Between 2017-03-12 02:00:00 and 2017-03-12 02:59:59 that time just simply doesn't exist that's why you're getting that error.
在 2017-03-12 02:00:00 和 2017-03-12 02:59:59 之间,那个时间根本不存在,这就是您收到该错误的原因。