Reputation: 1727
The documentation states that -
the range for TIMESTAMP values is '1970-01-01 00:00:01.000000' to '2038-01-19 03:14:07.999999'
But when I get this when I try to enter the maximum value:
mysql> insert into integration_table (`TIMESTAMP`) VALUES ('2038-01-19 03:14:07.999999');
ERROR 1292 (22007): Incorrect datetime value: '2038-01-19 03:14:07.999999' for column 'TIMESTAMP' at row 1
If I incrementally decrease the value, the maximum value that will work is '2038-01-19 03:14:07.499999'
mysql Ver 8.0.11 for Linux on x86_64 (MySQL Community Server - GPL)
(running in Docker)`TIMESTAMP` timestamp NULL DEFAULT NULL,
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
I know that MySQL supports microseconds since version 5.6.4, so that's not the issue.
Am I misunderstanding something or is this some configuration issue?
Thanks
Upvotes: 2
Views: 3223
Reputation: 1727
Defining the column as TIMESTAMP
means it does not support microseconds, so .5 and above will be rounded up, which makes this value out of range.
The column needs to be defined as TIMESTAMP(6)
to support 6 digit microseconds.
Upvotes: 3