ZF-10492: Incorrect date output (year 2041) using specific timezones


Creating a Zend_Date object based on a string (format "yyyy-MM-dd HH:mm:ss") including a year like 2041 and using specific timezones, generates a wrong date output.

Here is the code : $t = '2041-08-01 00:00:00'; $zd = new Zend_Date($t, 'yyyy-MM-dd HH:mm:ss'); echo $zd;

Expected output: "1 août 2041 00:00:00" Output: "1 août 2041 01:00:00"

The bug may be reproduced using timezone "Europe/Brussels", "America/New_York", and others probably. There is no error when using e.g. "Europe/Berlin" timezone.

There is no error using DateTime classes in PHP. Code comparing ZF Zend_Date class output with PHP DateTime class below:

$t = '2041-08-01 00:00:00'; //Try in DateTime $dt = new DateTime($t); echo $dt->format('Y-m-d H:i:s') . "
"; //Try with Zend_Date $zd = new Zend_Date($t, 'yyyy-MM-dd HH:mm:ss'); echo $zd . "

I asked other people to test it on IRC #zftalk, and they also may reproduce the bug.


I believe this is one of Thomas's components.

Setting component

This was likely fixed by a similar ticket, cannot reproduce.

Reopening issue: Needs to be verified and added as test Assigned to component author