note 19400 deleted from function.mktime by vincent
| From: | vincent@php.net | Date: | Wed, 10 Sep 2003 19:13:30 +0000 |
| Subject: | note 19400 deleted from function.mktime by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-56020@lists.php.net to get a copy of this message | ||
Note Submitter: bob@bobarmadillo.com
----
one of the examples shows
mktime(0,0,0,12,32,1997)
which gives the first day of the next month - in this case, January 1, 1998.
but be careful! using 32 only works when the month has 31 days. For months with 30 days or
february you get the 2nd, 3rd or even 4th of the next month.
instead use:
mktime(0,0,0,$month+1,1,$year)
for the first day of the next month or
mktime(0,0,0,$month+1,0,$year)
for the last day of the current month.
Note: doesn't work right on years that have 13 months. ;-)