diff --git a/ext/date/lib/unixtime2tm.c b/ext/date/lib/unixtime2tm.c index 871fa2f5e51..a76fa80991e 100644 --- a/ext/date/lib/unixtime2tm.c +++ b/ext/date/lib/unixtime2tm.c @@ -146,7 +146,7 @@ void timelib_update_from_sse(timelib_time *tm) int z = tm->z; signed int dst = tm->dst; - timelib_unixtime2gmt(tm, tm->sse - (tm->z * 60)); + timelib_unixtime2gmt(tm, tm->sse - (tm->z * 60) + (tm->dst * 3600)); tm->z = z; tm->dst = dst; @@ -184,7 +184,7 @@ void timelib_unixtime2local(timelib_time *tm, timelib_sll ts) int z = tm->z; signed int dst = tm->dst; - timelib_unixtime2gmt(tm, ts - (tm->z * 60)); + timelib_unixtime2gmt(tm, ts - (tm->z * 60) + (tm->dst * 3600)); tm->z = z; tm->dst = dst; diff --git a/ext/date/tests/bug55253.phpt b/ext/date/tests/bug55253.phpt index 3c0efc4691d..3b2b42bc262 100755 --- a/ext/date/tests/bug55253.phpt +++ b/ext/date/tests/bug55253.phpt @@ -1,9 +1,7 @@ --TEST-- -DateTime::add() and sub() result -1 hour on objects with time zone type 2 +Bug #55253: DateTime::add() and sub() result -1 hour on objects with time zone type 2 --CREDITS-- Daniel Convissor ---XFAIL-- -Bug 55253 exists --FILE-- format('U'); +var_dump($ts); +$t->setTimestamp($ts); +var_dump($t); +?> +--EXPECT-- +string(10) "1278455908" +object(DateTime)#1 (3) { + ["date"]=> + string(19) "2010-07-06 18:38:28" + ["timezone_type"]=> + int(2) + ["timezone"]=> + string(3) "EDT" +} diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type2.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type2.phpt index 58136025136..72585125ea6 100644 --- a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type2.phpt +++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type2.phpt @@ -2,8 +2,6 @@ RFC: DateTime and Daylight Saving Time Transitions (zone type 2) --CREDITS-- Daniel Convissor ---XFAIL-- -RFC not implemented yet --FILE--