|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-02-02 10:06 UTC] mguichar at univ-lr dot fr
[2009-02-02 10:20 UTC] mguichar at univ-lr dot fr
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 29 09:00:01 2025 UTC |
Description: ------------ When I add 1 hour to Datetime Object (using modify function), it's not 1 hour but 2 hour which are added. This bug appear only for date : 2001-03-25 01:03:00 / 2002-03-31 01:03:00 / 2003-03-30 01:03:00 / 2004-03-28 01:03:00 / 2005-03-27 01:03:00 / 2006-03-26 01:03:00 / 2007-03-25 01:03:00 / 2008-03-30 01:03:00 Reproduce code: --------------- $date= date_create('2001-03-25 01:03:00'); echo $date->format("Y-m-d H:m:s")." +1 hour =>\n"; $date->modify("+1 hour"); echo $date->format("Y-m-d H:m:s")."\n\n"; $date= date_create('2002-03-31 01:03:00'); echo $date->format("Y-m-d H:m:s")." +1 hour =>\n"; $date->modify("+1 hour"); echo $date->format("Y-m-d H:m:s")."\n\n"; ... Expected result: ---------------- 2001-03-25 01:03:00 +1 hour => 2001-03-25 02:03:00 2002-03-31 01:03:00 +1 hour => 2002-03-31 02:03:00 ... Actual result: -------------- 2001-03-25 01:03:00 +1 hour => 2001-03-25 03:03:00 2002-03-31 01:03:00 +1 hour => 2002-03-31 03:03:00 ...