Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL TIMESTAMP value greater than '2038-01-19 03:14:07'

I'm wondering what will happen after 2038-01-19 03:14:07 with table fields using TIMESTAMP as data type?

I always preferred DATETIME but you apparently can't assign CURRENT_TIMESTAMP as default value to that type. I mean, 28 years is not so long when you think about it (in my opinion anyway)... So what will happen to all those TIMESTAMP fields then?

like image 432
Yanick Rochon Avatar asked Nov 14 '22 08:11

Yanick Rochon


1 Answers

You may not be able to assign CURRENT_TIMESTAMP to a DATETIME column, but you can assign NOW() to it.

As for the y2k+38 issue, I'm willing to bet there will be newer versions of MySQL that will address this long before it is a real concern.

like image 187
Fosco Avatar answered Jan 04 '23 23:01

Fosco