note 102713 modified in function.date by danbrown
| From: | danbrown@php.net | Date: | Mon, 20 Jun 2011 14:54:01 +0000 |
| Subject: | note 102713 modified in function.date by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-180693@lists.php.net to get a copy of this message | ||
Found it useful to do some quick calculations on a date by doing something like this.
$var = date('F d, Y', strtotime("-1 month -4 days"));
This quickly returns something like this:
February 28, 2011
But, it will return the date that was one month and four days from the current date. Easy to get
calculations based on that especially in cases where there are not 31 days in a month.
Brian S.
BsnTech Networks
--was--
Found it useful to do some quick calculations on a date by doing something like this.
$var = date('F d, Y', strtotime("-1 month -4 days"));
This quickly returns something like this:
February 28, 2011
But, it will return the date that was one month and four days from the current date. Easy to get
calculations based on that especially in cases where there are not 31 days in a month.
Brian S.
BsnTech Networks
http://www.bsntech.com
http://php.net/manual/en/function.date.php