ZF-12285: Error in Zend_Date timestamp to date format conversion using "YYY : Year according to ISO 8601, at least three digit"
Description
The following piece of code get me the wrong year piece in the timestamp to date conversion result;
$date = new Zend_Date(1356974896, Zend_Date::TIMESTAMP); $str = $date->get("MM-dd-YYY");
I get '12-31-2013' instead of '12-31-2012' as expected. Other timestamps that fall into 2012 work ok though...maybe something due to the last day of the year ?
This same piece of code was working and returning correct dates for a long time, I just got this reported to me for specific entries, the common denominator as I was saying is that they are all of 12-31-2012.
Hope this input helps.
Regards, Gonzalo.
Regards, Gonzalo.
Comments
Posted by Matthew Weier O'Phinney (matthew) on 2012-06-12T21:29:42.000+0000
This is now fixed as of r24880 on trunk, and will release with 1.12.0.
Basically, it's an issue with the "o" format identifier; first and last week of the year cause issues, and are often reported with the previous and next year, respectively. (See http://php.net/date and look for the "o" format in there for details.)