Friends, there is a date 2300-01-01 00:00:00

strtotime('2300-01-01 00:00:00') yields nothing. question why ?? in some places on the site I used the same code and everything works ..

    2 answers 2

    From the description of the strtotime function

    The correct timestamp range is usually from December 13, 1901 20:45:54 UTC to January 19, 2038 03:14:07 UTC . (These dates correspond to the minimum and maximum value of a 32-bit signed integer).

    In addition, prior to PHP 5.1.0, not all platforms support negative time stamps, so the supported date range can be limited to the Unix Epoch. This means that dates earlier than January 1, 1970 will not work on Windows, some Linux distributions, and several other operating systems.

    In 64-bit versions of PHP, the correct timestamp range is virtually endless , since 64 bits are enough to represent approximately 293 billion years in both directions.

    • thank! This is the correct answer - WhoIsDT

    The strtotime function accepts a string. This is how strtotime('2300-01-01 00:00:00') should work strtotime('2300-01-01 00:00:00')

    • @iSeeDev Gratitude can be expressed by marking the answer as correct) - Artem Y
    • strtotime ($ data_card ['active']) - in this case, void will come out. if we display $ data_card ['active'] separately, we will get 2300-01-01 00:00:00 - WhoIsDT
    • Maybe a mistake due to too big a year? if so why? - WhoIsDT
    • @iSeeDev try again like this: strtotime (strval ($ data_card ['active'])) If it doesn’t work, provide all the code, including where $ data_card variable comes from - Artem Y
    • That doesn't seem to be the case. some kind of nonsense. In general In the database, this active field has DATETIME. Just because I changed the value to 2016-01-01 00:00:00 - and in this case, the correct strtotime was output, as soon as I change the year to 2100 - it gives out emptiness .. why is that so? - WhoIsDT