ZF-3724: inconsistent results

Issue Type: Bug Created: 2008-07-23T09:45:16.000+0000 Last Updated: 2008-12-17T14:35:18.000+0000 Status: Resolved Fix version(s): - 1.5.3 (28/Jul/08)

Reporter: Radek (salac.r) Assignee: Thomas Weidner (thomas) Tags: - Zend_Date

Related issues: - ZF-5297



I have this simple code

$date = new Zend_Date('2007-12-29'); echo $date->toString('YYYY-MM-dd').' / '.$date; echo "
"; $date=$date->addDay(1); echo $date->toString('YYYY-MM-dd').' / '.$date; echo "
"; $date=$date->addDay(1); echo $date->toString('YYYY-MM-dd').' / '.$date;

and the result is: 2007-12-29 / 29.12.2007 0:00:00 2007-12-30 / 30.12.2007 0:00:00 2008-12-31 / 31.12.2007 0:00:00 // Note this one


Posted by Thomas Weidner (thomas) on 2008-07-24T03:51:07.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'.

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.