ZF-3982: Some dates are not possible with Zend_Date

Issue Type: Bug Created: 2008-08-18T07:14:43.000+0000 Last Updated: 2008-08-18T08:07:29.000+0000 Status: Resolved Fix version(s): - 1.6.1 (15/Sep/08)

Reporter: S├ębastien BERVOETS (ramsesservices) Assignee: Thomas Weidner (thomas) Tags: - Zend_Date

Related issues: - ZF-3724



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;


Posted by Thomas Weidner (thomas) on 2008-08-18T08:06:50.000+0000

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

Posted by Thomas Weidner (thomas) on 2008-08-18T08:07:29.000+0000

Duplication of ZF-3724

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.