Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upDate from mysql is wrong converted to Nette/Utils/DateTime #169
Comments
|
|
|
For interest Mysql 5.7 does not allow invalid datetime "0000-00-00 00:00:00". Let's prepare your databese :) Like @hrach recommended you. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
In my application, I read date from database, and write it to other table.
Date "0000-00-00 00:00:00" is bad converted to php, and cannot be saved back to mysql.
Exception:
SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '-0001-11-30 00:00:00' for column 'date' at row 1
Steps To Reproduce
In database I have date "0000-00-00 00:00:00", data type is datetime not null. InnoDB.
I use simple NDBT select
PHP 7.1.2, mysql 5.6.22, I use InnoDB for all tables.