Bug #67001 [Opn->Nab]: Time functions affected by machine timezone and current time
| From: | derick@php.net | Date: | Tue, 01 Apr 2014 14:03:23 +0000 |
| Subject: | Bug #67001 [Opn->Nab]: Time functions affected by machine timezone and current time | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-185011@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67001&edit=1
ID: 67001
Updated by: derick@php.net
Reported by: danmath01 at yahoo dot com dot ar
Summary: Time functions affected by machine timezone and
current time
-Status: Open
+Status: Not a bug
Type: Bug
Package: Date/time related
Operating System: Windows + Linux
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP --
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
I can not reproduce this with PHP 5.4.26 and PHP 5.5.7 (but I can with 5.3.22). Can you please
upgrade to a later PHP version?
Previous Comments:
------------------------------------------------------------------------
[2014-04-01 13:59:13] danmath01 at yahoo dot com dot ar
Description:
------------
Given an input the DateTime class will produce outputs that are affected by the current default
timezone and the current time. The test script provided uses the timestamp for 2013-01-01 00:00:00
and shows that adding 0 minutes can return a result that is 1 hour later. This was observed running
the script on the 31st of March 2014, during BST (end of March to end of October), although the
localtime should not affect the script. Changing the localtime back 1 week or moving it past October
and running the script produces the correct output. This was observed on both Windows with PHP 5.4.7
and on Linux with PHP 5.3.27 and not reproducible on Linux with PHP 5.3.3.
Test script:
---------------
<?php
date_default_timezone_set('Europe/London');
echo date_default_timezone_get(), "\n";
$timestamp= new DateTime("@1356998400");
echo $timestamp->format('Y-m-d H:i:s'), "\n";
$timestamp->modify("+ 0 minutes");
echo $timestamp->format('Y-m-d H:i:s'), "\n";
?>
Expected result:
----------------
Europe/London
2013-01-01 00:00:00
2013-01-01 00:00:00
5.4.7
Actual result:
--------------
Europe/London
2013-01-01 00:00:00
2013-01-01 01:00:00
5.4.7
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67001&edit=1