You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since MySQL 5.7, the "zero timestamp" option is disabled by default. See the upgrade notes.
This means that not only are 0 and 0000-00-00 00:00:00 invalid defaults for timestamp columns, but that 1970-01-01 00:00:00 is also invalid.
The earliest possible timestamp is 1970-01-01 00:00:01. See the docs.
Be aware that timestamp fields are adjusted for the current timezone (SHOW VARIABLES LIKE '%time_zone%'). DEFAULT '1970-01-01 00:00:01' will work on a server in UTC, but fail on one in UTC+1. DEFAULT '1969-12-31 23:00:01' will work on a server in UTC-1, but fail on one in UTC.
The text was updated successfully, but these errors were encountered:
Since MySQL 5.7, the "zero timestamp" option is disabled by default. See the upgrade notes.
This means that not only are
0
and0000-00-00 00:00:00
invalid defaults fortimestamp
columns, but that1970-01-01 00:00:00
is also invalid.The earliest possible timestamp is
1970-01-01 00:00:01
. See the docs.Be aware that timestamp fields are adjusted for the current timezone (
SHOW VARIABLES LIKE '%time_zone%'
).DEFAULT '1970-01-01 00:00:01'
will work on a server in UTC, but fail on one in UTC+1.DEFAULT '1969-12-31 23:00:01'
will work on a server in UTC-1, but fail on one in UTC.The text was updated successfully, but these errors were encountered: