note 92113 added to datetime.modify

From: Date: Thu, 09 Jul 2009 10:37:53 +0000
Subject: note 92113 added to datetime.modify
Groups: php.notes 
Request: Send a blank email to php-notes+get-158098@lists.php.net to get a copy of this message
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 ---- Server IP: 217.13.201.10 Probable Submitter: 212.114.201.34 ---- Manual Page -- http://www.php.net/manual/en/datetime.modify.php Edit -- https://master.php.net/note/edit/92113 Del: integrated -- https://master.php.net/note/delete/92113/integrated Del: useless -- https://master.php.net/note/delete/92113/useless Del: bad code -- https://master.php.net/note/delete/92113/bad+code Del: spam -- https://master.php.net/note/delete/92113/spam Del: non-english -- https://master.php.net/note/delete/92113/non-english Del: in docs -- https://master.php.net/note/delete/92113/in+docs Del: other reasons-- https://master.php.net/note/delete/92113 Reject -- https://master.php.net/note/reject/92113 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#158098) next »