Bug #66963 [Opn->Nab]: Same code returns different results after php update
| From: | johannes@php.net | Date: | Fri, 28 Mar 2014 18:24:33 +0000 |
| Subject: | Bug #66963 [Opn->Nab]: Same code returns different results after php update | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-184948@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66963&edit=1
ID: 66963
Updated by: johannes@php.net
Reported by: pedro dot bicudo at tgtconsult dot com dot br
Summary: Same code returns different results after php update
-Status: Open
+Status: Not a bug
Type: Bug
Package: Date/time related
Operating System: Linux CentOS 6
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Times are calculated based on the Olson database which is maintained by IANA. We bundle always the
at release time current version. Youcan figure out which version is being used from phpinfo() in the
field ""Olson" Timezone Database Version" under "date" or by using the
timezone_version_get() function.
See http://www.iana.org/time-zones for information from
IANA.
Previous Comments:
------------------------------------------------------------------------
[2014-03-27 01:41:46] pedro dot bicudo at tgtconsult dot com dot br
aharvey, I double checked and found different timezones (UTC and Americas/Sao_Paulo), new problem
now, from the test script posted: for date 2014-01-01 difference is 7200 seconds (2hours) and for
date 2014-06-14 difference is 10800s (3hours). Daylight savings? Can you point me to the
documentation of how time gets calculated by PHP?
------------------------------------------------------------------------
[2014-03-27 00:57:31] pedro dot bicudo at tgtconsult dot com dot br
Yes, same timezone.Changing timezones did not change the results.
------------------------------------------------------------------------
[2014-03-26 22:57:32] aharvey@php.net
Are you sure that each PHP version is running with the same default time zone set? You can check
that by calling date_default_timezone_get().
------------------------------------------------------------------------
[2014-03-26 22:52:54] pedro dot bicudo at tgtconsult dot com dot br
Description:
------------
Using amazon-linux-ami/2013.09; Linux 3.4.48-45.46.amzn1.x86_64 on x86_64. Date shown for user is
wrong. To isolate any database error during test, I've created the date with php and then show
the timestamp. Different versions of php show different results. Version 5.3.28 is the latest PHP
available for his AWS instance. Apache 2.2.26.
Test script:
---------------
$date=date_create("2014-01-01");echo date_timestamp_get($date);
$date=date_create("2014-06-14");echo date_timestamp_get($date);
Expected result:
----------------
For date 2014-01-01:
php 5.3.26 returns 1388534400 (correct result)
php 5.3.28 returns 1388541600
For date 2014-01-01:
php 5.3.26 returns 1402704000 (correct result)
php 5.3.28 returns 1402714800
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66963&edit=1