32bit vs 64bit - 32bit can't handle 2100 in strtotime?

Chris Adams cmadams at hiwaay.net
Mon Jun 27 15:46:35 UTC 2011


Once upon a time, Michał Piotrowski <mkkp4x4 at gmail.com> said:
> I would like to note that I am aware of that 32 bit systems will not
> work after 2038. But does that mean that they can not do simple date
> conversion?

Not if that "simple" date conversion uses the system time_t functions
(which most of the common functions do).  If you need to handle dates
outside the range of 1970-2038, you'll need to use alternate functions
that can handle the expected date range (and I don't know if such exist
in PHP; you may have to code them yourself).

Portable code should not assume system date routines can handle dates
outside 1970-2038; you shouldn't depend on 64 bit systems having larger
time_t (I don't think they all do).
-- 
Chris Adams <cmadams at hiwaay.net>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.


More information about the devel mailing list