#47271 [Opn->Csd]: Datetime::Modify

From: Date: Mon, 02 Feb 2009 10:20:36 +0000
Subject: #47271 [Opn->Csd]: Datetime::Modify
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-133360@lists.php.net to get a copy of this message
ID: 47271 User updated by: mguichar at univ-lr dot fr Reported By: mguichar at univ-lr dot fr -Status: Open +Status: Closed Bug Type: Date/time related Operating System: Windows / Linux PHP Version: 5.2.8 New Comment: Error come from default timezone ... Previous Comments: ------------------------------------------------------------------------ [2009-02-02 10:06:51] mguichar at univ-lr dot fr Same bug with date : 1998/03/29 1999/03/28 2000/03/26 and probably for each year before 1998 ! ------------------------------------------------------------------------ [2009-02-02 09:58:42] mguichar at univ-lr dot fr 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 ... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47271&edit=1

« previous php.bugs (#133360) next »