ZF-11230: DST problems with Zend_Date::set() with Zend_Date::TIMES
Description
Use-case: today is 2011-03-27 and DST change has been applied at night. Timezone - Europe/Kiev
$from = new Zend_Date();
$from->set('00:00:00', Zend_Date::TIMES);
expected result: 2011-03-27 00:00:00
actual result: 2011-03-26T23:00:00+02:00
Comments
Posted by Andrey Shevchenko (distdev) on 2011-03-27T10:44:30.000+0000
Proposed patch:
Zend_Date::_calculate, around line 2262 (case self::TIMES)
change last parameter from false to $parsed['hour'], so _assign method will correct DST offset
Posted by Thomas Weidner (thomas) on 2011-03-27T18:38:57.000+0000
Please give a complete date output for reproduction from the created and the changed date. Complete outputs can be created by $date->getIso() as described in the manual and the FAQ.
The patch is not accepted as it breaks existing tests.
Posted by Andrey Shevchenko (distdev) on 2011-03-27T20:08:12.000+0000
outputs
outputs2011-03-26T23:00:00+02:00 ````
Posted by Andrey Shevchenko (distdev) on 2011-04-28T11:22:55.000+0000
Could you please specify, what test was broken? I've just run it with new test, result is OK:
{quote} Zend Framework Zend Framework - Zend Zend_DateTest .......................................................... ........................I.............................
Zend Framework - Zend_Date_Date Zend_Date_DateObjectTest ...................
Time: 48 seconds, Memory: 276.50Mb
There was 1 incomplete test:
1) Zend_DateTest::testTimesync NTP timeserver not available.
D:\Denwer\home\zf\www\tests\Zend\DateTest.php:4973 OK, but incomplete or skipped tests! Tests: 131, Assertions: 1868, Incomplete: 1. {quote}
Unfortunately, I can't attach a patch as a file, so I attach it inline :)