Solving SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value

This probably occurs if you're STRICT_TRANS_TABLES is set in sql-mode in my.cnf


To disable immediately, run:

    set sql_mode=NO_ENGINE_SUBSTITUTION; set global sql_mode=NO_ENGINE_SUBSTITUTION;

To disable forever, edit my.conf and change sql_mode



Checking it's disabled


mysql> SHOW VARIABLES LIKE 'sql_mode';

The value should read NO_ENGINE_SUBSTITUTION

| Variable_name | Value                  |
| sql_mode      | NO_ENGINE_SUBSTITUTION |
1 row in set (0.00 sec)