Issues

ZF-4820: Zend_date 12 december 2009 to januari 2010 problem

Issue Type: Bug Created: 2008-11-06T04:45:52.000+0000 Last Updated: 2008-12-17T14:40:44.000+0000 Status: Resolved Fix version(s): Reporter: Justin V (evil_easterbunny) Assignee: Thomas Weidner (thomas) Tags: - Zend_Date

Related issues: - ZF-5297

Attachments:

Description

I have a strange problem with Zend_Date when adding 1 month to December 2009. Zend_Date goes back to January 2009 instead of increasing the year to 2010.

I used this code to test it: ( tested with versions 1.6.1, 1.6.2 and trunk)

2008, 'month' => 12, 'day' => 01 ) ); echo $oDate->toString( 'dd-MM-YYYY' ) . " "; $oDate->addMonth( 1 ); echo $oDate->toString( 'dd-MM-YYYY' ) . " "; $oDate = new Zend\_Date( array( 'year' => 2009, 'month' => 05, 'day' => 01 ) ); echo $oDate->toString( 'dd-MM-YYYY' ) . " "; $oDate->addMonth( 1 ); echo $oDate->toString( 'dd-MM-YYYY' ) . " "; $oDate = new Zend\_Date( array( 'year' => 2009, 'month' => 12, 'day' => 01 ) ); echo $oDate->toString( 'dd-MM-YYYY' ) . " "; $oDate->addMonth( 1 ); echo $oDate->toString( 'dd-MM-YYYY' ) . " "; ?> Results: 01-12-2008 01-01-2009 <== as expected 01-05-2009 01-06-2009 <== as expected 01-12-2009 01-01-2009 <== expected 01-01-2010 here

Comments

Posted by Dolf Schimmel (Freeaqingme) (freak) on 2008-11-06T04:58:01.000+0000

The "problem" is described in the manual.

By replacing all YYYY with yyyy it gives me this (as expected): 01-12-2008 01-01-2009 01-05-2009 01-06-2009 01-12-2009 01-01-2010

..closing as not an issue for now.

Posted by Justin V (evil_easterbunny) on 2008-11-06T05:39:24.000+0000

@Dolf,

Hmzzz stupid me, why didn't I think of that.... Thnx!

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts