php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25233 strtotime() fails on dates < Jan 1 1970
Submitted: 2003-08-25 05:31 UTC Modified: 2003-08-25 09:37 UTC
From: alain at valain dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.3.2 OS: Linux Redhat 7.3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: alain at valain dot com
New email:
PHP Version: OS:

 

 [2003-08-25 05:31 UTC] 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";
?>



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-25 09:37 UTC] jay@php.net
This is a glibc problem. glibc is just following the POSIX 
standard now. See 
 
http://bugs.php.net/bug.php?id=23475 
 
J 
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 01:01:33 2025 UTC