Mysql timestamp valid range, mysql range
Things
From_unixtime/unix_timestamp overflow, unavailable
Cause
The number of seconds since returned by from_unixtime is the result of int type, and the valid range of int Is [-2 ^ 31 + 1, 2 ^ 31-1], that is, [-2147483648,214 7483648], 2147483648/365/24/3600 is converted to an adult for more than 68 years, and the maximum validity period is one day on January 1, 2038.
Processing
Compatible with the previous processing. It can be used first. Then, it is added after minus 30 years. Now it can be extended for 30 years.
Select date_add (from_unixtime (2524464000-946656000), interval 30 year );
Select (unix_timestamp (date_add ('2017-01-01 00:00:00 ', interval-30 year) + 2050 );
However, the current practice is to add a field to the data table and directly use varchar (10) to save the time, instead of numerical values.