因为从那天开始是夏令时,所以凌晨1点到2点之间的所有时间都是无效的。您会发现问题实际上从“01:00:00”开始,到“01:59:59”结束:
create table t (created_at timestamp null default current_timestamp);
insert into t values('2019-03-31 00:59:59');
insert into t values('2019-03-31 01:00:00');
日期时间值不正确:第1行“created\u at”列的“2019-03-31 01:00:00”
insert into t values('2019-03-31 01:59:59');
datetime值不正确:“2019-03-31 01:59:59”用于第1行的“created\u at”列
insert into t values('2019-03-31 02:00:00');
select * from t
输出:
created_at
2019-03-31 00:59:59
2019-03-31 02:00:00
将系统时区更改为没有夏令时的时区可以解决问题。