ZF-12285: Error in Zend_Date timestamp to date format conversion using "YYY : Year according to ISO 8601, at least three digit"

Issue Type: Bug Created: 2012-06-12T17:25:27.000+0000 Last Updated: 2012-06-12T21:29:50.000+0000 Status: Resolved Fix version(s): Reporter: Gonzalo Martinez (gmartine) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Date

Related issues: Attachments:


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.


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 and look for the "o" format in there for details.)

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.