I have a MySQL table which has a column called “created_at” which is a TIMESTAMP field. Whenever I try to insert datetime bigger than 2037 I get the following error:
#1292 - Incorrect datetime value: '2039-06-18 16:54:35' for column 'created_at' at row 1
I get that this a problem with 32bit MySQL but I am running 64bit shouldn’t that be the solution?
Here is the output of the command for the version of my MySQL:
mysqld Ver 5.7.26-0ubuntu0.18.04.1 for Linux on x86_64 ((Ubuntu))
Reading this suggesting that using the TIMESTAMP field is the problem and using DATETIME fields will solve it, is that correct?
2
Answers
TIMESTAMP remains UNIX TIMESTAMP (32Bit) for compatibility reasons…
The suggestion you’ve read is correct, use DATETIME instead.
You should use
DATETIME
data type.