Issues

ZF-11786: Zend date behaves incorrectly with some timezones

Description

Check the following code:

// Default timezone set to GMT -4 - America/Santiago
date_default_timezone_set('America/Santiago');

$zendDate = new Zend_Date('16/09/2011', Zend_Date::DATE_MEDIUM, 'es_ES');
$zendDate->setTimezone('UTC');

echo $zendDate->get(Zend_Date::ISO_8601);

The returned value is 2011-09-16T05:00:00+00:00 while i expect to receive 2011-09-16T04:00:00+00:00. For some reason Zend_Date is adding an extra hour in this case.

I tested with other timezones like America/Sao_Paulo and it worked fine. Although i can't discard that with other timezones it may also fail.

Thanks!

Comments

No comments to display