|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-04-01 14:03 UTC] derick@php.net
-Status: Open
+Status: Not a bug
[2014-04-01 14:03 UTC] derick@php.net
[2014-04-01 14:17 UTC] danmath01 at yahoo dot com dot ar
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 06 14:00:02 2026 UTC |
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