-2

When I am using date() function do add certain number of days to date is working with:

date('d.m.Y', strtotime("+".round(5000)." days"))

but it is not working with:

date('d.m.Y', strtotime("+".round(7500)." days"))

Is there anyone who knows why, and how do I fix this?

Teo Mihaila
  • 134
  • 1
  • 2
  • 18

1 Answers1

4

Likely it is due to the Year 2038 problem combined with a 32bit version of PHP.

You can check your php version by checking the value of the PHP_INT_SIZE constant (which will be 4 for x32 and 8 for x64).

Any dates after january 19'th 2038 overflows the 32-bit signed integer used for the Unix timestamp.

5000 days from today is March 27, 2032

7500 days from today is January 30, 2039

Using a 64bit version of PHP you should be good until year 292277026596.

Daniel
  • 10,641
  • 12
  • 47
  • 85