php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40645 strtotime don't work with negative timestamps
Submitted: 2007-02-26 17:55 UTC Modified: 2007-02-27 14:42 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: simone at ivg dot it Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.4.5 OS: Linux 2.6
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: simone at ivg dot it
New email:
PHP Version: OS:

 

 [2007-02-26 17:55 UTC] simone at ivg dot it
Description:
------------
The strtotime() function returns -1 if the date is prior to 1970-01-01.
Instead, date function works properly with negative timestamps.


Reproduce code:
---------------
strtotime("1951-12-22") returns -1
date("d/m/Y",-578944001) returns 28/08/1951



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-26 18:01 UTC] derick@php.net
This works fine for me with PHP 4.4.6RC2-dev:

<?php
echo strtotime("1951-12-22"), "\n";
?>

-568947600

 [2007-02-27 14:27 UTC] simone at ivg dot it
This isn't a PHP bug, but a GNU libc issue.
Here I've found a C code to test if my libc has the problem: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=196177

Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 16:01:31 2024 UTC