Issues

ZF-2909: Zend_Date::toString('ddMMYY') showing wrong year (+1)

Description


$date1 = new Zend_Date('301207', 'ddMMYY');
echo $date1->toString('ddMMYY');
echo $date1;

$date2 = new Zend_Date('311207', 'ddMMYY');
echo $date2->toString('ddMMYY');
echo $date2;

301207 30 Dec 2007 00:00:00

311208 // + 1 year 31 Dec 2007 00:00:00

It looks like the date was parsed correctly and it's stored internally with the right year but when I display it the year jumps to 2008

Comments

See into the manual http://framework.zend.com/manual/en/… There is a note after the section about using self defined ISO formats and often made mistakes due to wrong format tokens.

Instead of the ISO-year token you should use the real year token. So just change "Y" to "y" and that's it.

I'm assuming this fix is merged to the 1.5 release branch for release with 1.5.1. Please update JIRA if this is not the case.

This issue is not an issue... there is no change and also no fix