The DATETIME type is used for values that contain both date and time
parts. MySQL retrieves and displays DATETIME values in ‘YYYY-MM-DD
HH:MM:SS’ format. The supported range is ‘1000-01-01 00:00:00’ to
‘9999-12-31 23:59:59’. (http://dev.mysql.com/doc/refman/5.5/en/datetime.html)ALLOW_INVALID_DATES
Do not perform full checking of dates. Check only that the month is in
the range from 1 to 12 and the day is in the range from 1 to 31. This
is very convenient for Web applications where you obtain year, month,
and day in three different fields and you want to store exactly what
the user inserted (without date validation). This mode applies to DATE
and DATETIME columns. It does not apply TIMESTAMP columns, which
always require a valid date.
(http://dev.mysql.com/doc/refman/5.5/en/datetime.html)
If I type
SHOW VARIABLES LIKE ‘datetime%format’;
it says: %y- %m- %d %H: %i: %s
I tried to insert 1999-04-26 13:00:00 and says wrong syntax.
I tried to add to the table *ALLOW_INVALID_DATES* after declaring the DATETIME, then tried at the end of the table creation and error.
I’m puzzled…
Thank you for your time
This works fine for me: