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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 17:01:36 2024 UTC