|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32015 StrtoTime Function Giving Different Timestamps in different versions
Submitted: 2005-02-18 04:09 UTC Modified: 2005-03-20 18:09 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: rj at meadowbrook dot net Assigned:
Status: No Feedback Package: Date/time related
PHP Version: 5.0.2 OS: Linux
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.
Block user comment
Status: Assign to:
Bug Type:
From: rj at meadowbrook dot net
New email:
PHP Version: OS:


 [2005-02-18 04:09 UTC] rj at meadowbrook dot net
The exact same function produces two different timestamp results:

PHP 4.3.2
strtotime('12/01/04 9:00 AM');
produces 1101909600

PHP 5.0.2
strtotime('12/01/04 9:00 AM');
produces 1101909622

Any combination produces a result 22 seconds less in 5.0.2 that the result in 4.3.2

Reproduce code:

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-18 09:06 UTC]
Please try using this CVS snapshot:
For Windows:
 [2005-03-20 18:09 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

 [2008-05-08 21:29 UTC] alex at iweconsulting dot net
I'm testing a script that I wrote on a remote server.
My developement environment is on a Windows Platform with PHP 5.2.4
The production environment is a Unix PHP 5.2.5

The piece of script that does not work is the following:

$date = '11 May 2008';
echo $date;
echo "<br />";
$date = strtotime($date);
echo $date;
echo "<br />";
$date = date('d-M-Y H:i:s', $date);
echo $date;

On Windows PHP 5.2.4 the output is

11 May 2008
11-May-2008 00:00:00

On Unix PHP 5.2.5 it is

11 May 2008
11-May-2008 00:00:00

The two timestamps are different, even if the date() function returns the same result and the input string is the same.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Sep 23 00:03:38 2021 UTC