#25233 [Opn->Bgs]: strtotime() fails on dates < Jan 1 1970
| From: | jay@php.net | Date: | Mon, 25 Aug 2003 14:37:04 +0000 |
| Subject: | #25233 [Opn->Bgs]: strtotime() fails on dates < Jan 1 1970 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-46578@lists.php.net to get a copy of this message | ||
ID: 25233
Updated by: jay@php.net
Reported By: alain at valain dot com
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: Linux Redhat 7.3
PHP Version: 4.3.2
New Comment:
This is a glibc problem. glibc is just following the POSIX
standard now. See
http://bugs.php.net/bug.php?id=23475
J
Previous Comments:
------------------------------------------------------------------------
[2003-08-25 05:31:34] alain at valain dot com
Description:
------------
The strtotime() function fails with -1 on dates that are < Jan 1 1970.
This makes other PHP functions like date() to return
Jan 1 1970
on the "faulty" timestamp -1.
Reproduce code:
---------------
<?php
$usernaiss = date("d/m/Y", strtotime("Dec 31 1969 12:00AM"));
echo "<html>\n";
echo "<head></head>\n";
echo "<body>\n";
echo "Date de naissance: " . $usernaiss . "<br>\n";
echo "</body>\n";
echo "</html>\n";
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25233&edit=1