ZF-5296: Zend_Date returns wrong year for 2008-12-29 till 2008-12-31

Issue Type: Bug Created: 2008-12-17T05:07:55.000+0000 Last Updated: 2008-12-17T05:22:03.000+0000 Status: Resolved Fix version(s): Reporter: Christiaan Kras (htbaa) Assignee: Thomas Weidner (thomas) Tags: - Zend_Date

Related issues: - ZF-5297



Using Zend_Date I found out that when giving a date in the range 2008-12-29 till 2008-12-31 the year returned is wrong. It should return the year 2008, but instead it returns 2009. I changed the year to 2007 and 2009 but these didn't give any problems. Only for 2008. I also tried different locales (en_US and nl_NL).

<pre class="highlight">
// Should print 2008-12-29, but prints 2009-12-29
$date1 = new Zend_Date('2008-12-29');
print $date1->toString('YYYY-MM-dd') . "\n";

// Should print 2008-12-29, but prints 2009-12-31
$date2 = new Zend_Date('2008-12-31');
print $date2->toString('YYYY-MM-dd') . "\n";

// Should print 2009-12-29
$date3 = new Zend_Date('2009-12-29');
print $date3->toString('YYYY-MM-dd') . "\n";

This is all under Zend Framework 1.7.1


Posted by Dolf Schimmel (Freeaqingme) (freak) on 2008-12-17T05:15:52.000+0000

The issue is not that dates are shown incorrectly, it is the developers that can't read the manual/FAQ/whatever.

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.