Re: mktime fails for pre 1970 on Fedora 3
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: mktime fails for pre 1970 on Fedora 3

From: Gordon Burditt <gordon@hammy.burditt.org>
Date: Wed Nov 30 2005 - 05:27:28 CET

>> It's not glibc. It is much more deeply embedded in the depths of the
>> operating system. Just try to work with a date past February, 2038.
>
>I'm not referring to the 32/64 bit issue.

This isn't the 32/64 bit issue. This is the 31/32 bit issue.

>On some UNIX platforms, such as
>FreeBSD, mktime handles pre-1970 dates with a workable negative value. On
>many Linux distros all you get for anything before 1 Jan 1970 is -1. If
>Perl's Date::Calc can handle all this why can't PHP?

An OS with a 32-bit time_t has a choice. With the "negative" values
of a 32-bit integer, it can represent 1901-1969 or 2038-2106: pick
one. I take it Linux chose to handle 2038-2106, and you don't like
that choice.

I think POSIX says it's supposed to be unsigned, so arguably
Linux is right and the BSDs are wrong as far as standards compliance.

                                                Gordon L. Burditt
Received on Sat Dec 3 04:24:31 2005