Reputation: 81
I have a problem storing a date/time. i.e.
DBD::mysql::st execute failed: Incorrect datetime value: '2022-03-27 01:00:00' for column smets2
.electricity
.time
Now the only possible thing I can see wrong with this is that perhaps this time does not exist because of daylight savings. 01:00:00 became 02:00:00
Here's the SQL I used to create the table
create table if not exists electricity (time timestamp null, consumption double);
So my question are ...
Thanks
Upvotes: 2
Views: 1359
Reputation: 81
OK.
It seems that the problem is that I defined the field a 'timestamp' when it should have been 'datetime'.
'timestamp' fields get the timezone applied on input/output.
Won't make that mistake again :-)
Upvotes: 2