Accessing dates in PHP beyond 2038
You could use a 64bit platform.
The size of an integer is platform-dependent, although a maximum value of about two billion is the usual value (that's 32 bits signed). 64-bit platforms usually have a maximum value of about 9E18.
Source.
Find out your platform is 64bit with var_dump(PHP_INT_SIZE === 8)
. If TRUE
, your system is 64 bit.
You can alternatively use the DateTime
class, which internally represents the time components independently. Thus it is not susceptible to the 2038 limitation (unless you use ::getTimestamp).