I use Zend_Date to set and get the year, but it is not set as the correct year. I set the year in 2010, and it returns the year in 2009. What am I doing wrong? Is there a bug in Zend_Date ?
$date = new Zend_Date('2010-01-03', 'YYYY-MM-dd'); echo $date->toString('MMMM d, YYYY');
The year must be set correctly, because the annual part of the date works:
echo $date->get(Zend_Date::YEAR);
Decision:
Well, I got it to work ... You use lower case: yyyy
echo $date->toString('MMMM d, yyyy');
yyyy means ISO year . 2010-01-03 - Week 53, 7th day of ISO 2009.yyyy indicates the actual calendar year.
zend-framework
Andrew
source share