php.net |  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
Votes:1
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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2005-02-18 04:09 UTC] rj at meadowbrook dot net
Description:
------------
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:
---------------
n/a

Expected result:
----------------
n/a

Actual result:
--------------
n/a

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-18 09:06 UTC] derick@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.0-win32-latest.zip
 [2005-03-20 18:09 UTC] sniper@php.net
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
1210467600
11-May-2008 00:00:00

On Unix PHP 5.2.5 it is

11 May 2008
1210478400
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-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC