ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-dev
php-dev
#32015 [Com]: StrtoTime Function Giving Different Timestamps in different versions
by Alex At Iweconsulting Dot Net other posts by this author
May 8 2008 2:30PM messages near this date
#32015 [NEW]: StrtoTime Function Giving Different Timestamps in different versions | #32015 [Fbk->NoF]: StrtoTime Function Giving Different Timestamps in different versions
ID:               32015
 Comment by:       alex at iweconsulting dot net
 Reported By:      rj at meadowbrook dot net
 Status:           No Feedback
 Bug Type:         Date/time related
 Operating System: Linux
 PHP Version:      5.0.2
 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------

[2005-03-20 18:09:28] sniper@[...].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.



------------------------------------------------------------------------

[2005-02-18 09:06:19] derick@[...].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-02-18 04:09:34] 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


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=32015&edit=1
Thread:
Rj At Meadowbrook Dot Net
Alex At Iweconsulting Dot Net



Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved