Mysql Incorrect datetime value for a valid date/time

I was getting this error message.

Incorrect datetime value: ‘2015-03-29 01:40:44’

After a lot of head scratching and googling.  It a timezone issue I believe.

I ran this command before trying the insert and this solved it.

SET @@time_zone := '+00:00'

After this the insert worked perfectly.

With thanks to Dean Trower who posted this fix on the MariaDB page for timestamps.  I have to admit I was banging my head against the wall on this one as my timezone is GMT…

Be the first to comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.