The function to catch the day of the week of PHP has limit?

I am making a calendar using PHP and JS and it worked perfectly between the Year 1902 until 2037, since from 2038 the function to catch the day of the week in PHP returns an incorrect value. Is there a specific reason for this?

Follows the code used in the first image as far as it still works and in the second image where it starts to pick up the incorrect value.

In the image where you have the partition " / " on the left is the day of the week of the month and the right side the function return below.

function getDayWeek($date){
    return date("w", strtotime($date));
}

Calendar up to the month that runs normally

Calendar from the month that code returns incorrect value

 6
Author: Maniero, 2018-07-09

1 answers

Yes, it has, it is called Millennium II bug or Unix timestamp bug or Y2k38 problem . This is because Unix determined that the time would start on 01/01/1970 and would have precision that would fit in 32 bits, so making the count of how many seconds fit there (just over 2 billion, since it still has the signal), the deadline that can arrive is January 19, 2038, right at the beginning of the day.

How people use certain resources without knowing what they serve a lot of software is buggy , almost all do not know this and now the problem is much more serious than the bug of the millennium, because even if it has easy solution it continues to proliferate, now we have, perhaps, thousands of times more systems running than at the end of the last century, and that most had already been born without the problem of the turn of the century. It's tragic, but it's the current state of our area where people play programming.

Cannot handle date / time with anything that works with the default timestamp , as is the case with strtotime().

Also has the problem of Y10K, among other.

 8
Author: Maniero, 2020-07-24 16:08:59