Issues

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

Description

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).


// 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

Comments

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