Zend Framework

Zend_Date returns wrong year for 2008-12-29 till 2008-12-31

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.7.1
  • Fix Version/s: None
  • Component/s: Zend_Date
  • Labels:
    None

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

Issue Links

Activity

Hide
Dolf Schimmel (Freeaqingme) added a comment -

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

Show
Dolf Schimmel (Freeaqingme) added a comment - The issue is not that dates are shown incorrectly, it is the developers that can't read the manual/FAQ/whatever.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: