Issues

ZF-7474: Subsequent subtracting/addition actions on Zend_Date at end of year

Issue Type: Bug Created: 2009-08-04T07:03:21.000+0000 Last Updated: 2009-08-04T12:59:34.000+0000 Status: Resolved Fix version(s): - 1.9.1 (11/Aug/09)

Reporter: Sam Hauglustaine (sam) Assignee: Thomas Weidner (thomas) Tags: - Zend_Date

Related issues: - ZF-5297

Attachments:

Description

If you have a Zend_Date object $date with an internal date of 2009-12-28 00:00:00 and you perform $date->addWeek(1)->subMinute(1) the result is 2009-01-03 23:59:00.

Shouldn't this be 2010-01-03 23:59:00?

Comments

Posted by Sam Hauglustaine (sam) on 2009-08-04T07:12:04.000+0000

This only seems to be the case when you use this to dump to contents of $date: ->toString('YYYY-MM-dd HH:mm')

Posted by Thomas Weidner (thomas) on 2009-08-04T07:49:02.000+0000

According to ISO the ISO year is counted as this year where the first week contains a thursday.

For 2010 does this mean that the week beginning with 04.Jan is counted as first week of the year 2010.

The given behaviour is correct.

Posted by Thomas Weidner (thomas) on 2009-08-04T07:49:50.000+0000

Closing as non-issue due to wrong usage/expectations.

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