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

Issue Type: Bug Created: 2008-03-18T08:22:23.000+0000 Last Updated: 2008-03-21T17:50:45.000+0000 Status: Resolved Fix version(s): - 1.5.1 (25/Mar/08)

Reporter: Karol Grecki (antych) Assignee: Thomas Weidner (thomas) Tags: - Zend_Date

Related issues: Attachments:


<pre class="highlight">
$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


Posted by Thomas Weidner (thomas) on 2008-03-18T08:49:36.000+0000

See into the manual… 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.

Posted by Wil Sinclair (wil) on 2008-03-21T17:09:03.000+0000

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.

Posted by Thomas Weidner (thomas) on 2008-03-21T17:50:45.000+0000

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

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.