note 94759 deleted from datetime.modify by danbrown
| From: | danbrown@php.net | Date: | Mon, 23 Nov 2009 15:33:47 +0000 |
| Subject: | note 94759 deleted from datetime.modify by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-163190@lists.php.net to get a copy of this message | ||
Note Submitter: am at budsolutions dot co dot uk
----
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