Bug #14313 Updated: strtotime() and mktime() errors for dates before 1970
| From: | jasonh at trurocollege dot ac dot uk | Date: | Wed, 08 May 2002 15:29:04 +0000 |
| Subject: | Bug #14313 Updated: strtotime() and mktime() errors for dates before 1970 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-7252@lists.php.net to get a copy of this message | ||
ID: 14313
Updated by: jasonh@trurocollege.ac.uk
Reported By: vipm@mac.com
Status: Bogus
Bug Type: Date/time related
Operating System: windows98
PHP Version: 4.0.6
New Comment:
This still happens in PHP 4.2.0 under WinNT (dates before 1970 are
invalid). This makes it hard to use PHP with the MSSQL extension since
it converts fields to strings, and therefore you *need* to be able to
convert the strings it generates (such as "Sep 1 1969 12:00AM") to
timestamps if you want to perform any manipulations (or present the
date in a better format).
Obviously, Windows *can* cope with dates before 1970, as can every
Windows application I know of, so it's very hard to understand *why*
PHP is unique in not being able to cope. Is there not even a
workaround?
Previous Comments:
------------------------------------------------------------------------
[2001-12-02 06:28:41] derick@php.net
Not a bug... PHP uses the native system calls for this. The windows API
simply returns different (wrong) results. There is nothing that can be
done about it.
Derick
------------------------------------------------------------------------
[2001-12-01 23:13:55] vipm@mac.com
In PHP 4.0.6 for Linux and MacOSX, strtotime() and mktime() functions
produce correct output for dates before 1970, but in Windows98 and
Windows2000, I get an error (-1), e.g., strtotime("1965-3-12")
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=14313&edit=1