note 47997 deleted from function.strtotime by derick
| From: | derick@php.net | Date: | Sun, 14 Aug 2005 11:50:30 +0000 |
| Subject: | note 47997 deleted from function.strtotime by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-93593@lists.php.net to get a copy of this message | ||
Note Submitter: j_lozinski at yahoo dot co dot uk
----
If you're looking to get the 1st and last day of a month, then date() is what you want. For
example
date("Y-m-01") => 1st of this month
date("Y-m-t") => last of this month (t is num days in the month)
date("Y-m-t", strtotime("+1 Month")) => last day of next month.
the result from date() can be fed into strtotime, like so:
strtotime(date("Y-m-t")) => last of this month as unix timestamp