Question

Does anyone know of a workaround for storing values outside of the range '1970-01-01 00:00:01' UTC to '2038-01-09 03:14:07' UTC in a MySQL TIMESTAMP field?

Was it helpful?

Solution

If you alter the column to use the DATETIME type, you can store a wider range of values.

the TIMESTAMP type's range is '1970-01-01 00:00:01' UTC to '2038-01-09 03:14:07' UTC.

the DATETIME type's range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'.

OTHER TIPS

TIMESTAMP shouldn't be used for literal date/time values, it is for SQL Server synchronization.

Use SMALLDATETIME or DATETIME.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top