【发布时间】:2017-11-08 14:20:43
【问题描述】:
当我将这些值插入我的数据库表时出现此错误:
SQLSTATE[22007]:无效的日期时间格式:1292 不正确的日期时间值: 第 1 行的“registration_from”列的“24/06/2017” (SQL:插入`campus_registrations`(`campus_major_class_id`, `registration_from`, `registration_to`, `testing`, `announcement`, `enrollment_from`, `enrollment_to`, `updated_at`, `created_at`) 值 (3, 2017 年 6 月 24 日、2017 年 6 月 27 日、2017 年 7 月 13 日、2017 年 1 月 8 日、2017 年 5 月 9 日、2018 年 1 月 31 日、 2017-06-07 09:39:31, 2017-06-07 09:39:31))
我必须先启动日期时间还是什么?
【问题讨论】:
-
首先将您的表架构添加到问题中。
-
@kRicha 他们都是日期时间
-
@goateee25 尝试使用这种格式
date("Y-m-d H:i:s")