note 94759 added to datetime.modify
| From: | am at budsolutions dot co dot uk | Date: | Mon, 23 Nov 2009 14:59:44 +0000 |
| Subject: | note 94759 added to datetime.modify | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-163187@lists.php.net to get a copy of this message | ||
On the '+1 month' note, the same also applies to days.
Instead of going into complicated date-validation routines, one simple way around this is to convert
the number of days you want to modify by into hours. The modify() function will create a correct
date.
adding 4 days to 2008-02-27 creates 2008-02-31
adding 96 hours to 2008-02-27 creates 2008-03-02
----
Server IP: 69.147.83.197
Probable Submitter: 86.10.14.193
----
Manual Page -- http://www.php.net/manual/en/datetime.modify.php
Edit -- https://master.php.net/note/edit/94759
Del: integrated -- https://master.php.net/note/delete/94759/integrated
Del: useless -- https://master.php.net/note/delete/94759/useless
Del: bad code -- https://master.php.net/note/delete/94759/bad+code
Del: spam -- https://master.php.net/note/delete/94759/spam
Del: non-english -- https://master.php.net/note/delete/94759/non-english
Del: in docs -- https://master.php.net/note/delete/94759/in+docs
Del: other reasons-- https://master.php.net/note/delete/94759
Reject -- https://master.php.net/note/reject/94759
Search -- https://master.php.net/manage/user-notes.php