Zend Framework

Some dates are not possible with Zend_Date

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Critical Critical
  • Resolution: Not an Issue
  • Affects Version/s: 1.5.3
  • Fix Version/s: 1.6.1
  • Component/s: Zend_Date
  • Labels:
    None

Description

Hi dear,

I try to set specific dates in a Zend_Date object but I got another date :

Code :

$dayDate = Zend_Date::now();
$dayDate->setYear(2008);
$dayDate->setMonth(12);
$dayDate->setDay(29);
echo $dayDate->toString('dd/MM/YYYY');

This give me : 29/12/2009 and not 29/12/2009

The problem appears with some date (ex: 31/12/2007, ...)

Thanks for your feedback

--Edit on 2008-08-18
The problem seems to come from toString() function. toArray() function returns right values;

Issue Links

Activity

Hide
Thomas Weidner added a comment -

Please look into the documentation for the proper usage of the date constants.
'YYYY' is not the real year... it's the ISO Year used for calendar representations.
The result is correct.
For real year use 'yyyy' as described in the manual. There is an extra paragraph about the difference between 'Y' and 'y'.

Show
Thomas Weidner added a comment - Please look into the documentation for the proper usage of the date constants. 'YYYY' is not the real year... it's the ISO Year used for calendar representations. The result is correct. For real year use 'yyyy' as described in the manual. There is an extra paragraph about the difference between 'Y' and 'y'.
Hide
Thomas Weidner added a comment -

Duplication of ZF-3724

Show
Thomas Weidner added a comment - Duplication of ZF-3724

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: