Accessing dates in PHP beyond 2038

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).


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.


PHP has introduced Datetime() class in version 5.2 to solve this problem. But you still must be in 64-bit OS.


You are correct in that PHP doesn't allow you to handle dates > 2038, natively. However there are libraries such as this one that take advantage of the fact that floating points are 64 bit, thus allowing you to bypass this issue if need be. (All under the assumption that you are using a 32 bit system... if you are using 64 bit, you are fine).