note 92113 deleted from datetime.modify by danbrown
| From: | danbrown@php.net | Date: | Thu, 09 Jul 2009 14:01:02 +0000 |
| Subject: | note 92113 deleted from datetime.modify by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-158105@lists.php.net to get a copy of this message | ||
Note Submitter: alex aulbach
----
In response to tacker at php dot net:
The behaviour of +1 month is maybe not expected. But what do you await? The behavior is common
knowledge, because of many reasons. The easiest reason to understand is this:
2008-02-29 + 1 year = 2009-03-01
The 29 February is a valid date in a leap-year. But not in the following year. The calculation is
correct, because:
2008-02-29 + 4 year = 2012-02-29
Or to take your example:
2009-05-31 + 1 month = 2009-07-01
2009-05-31 + 2 month = 2009-07-31