Previous and Next Month and Year
| From: | Keith Spiller | Date: | Sun, 17 Jun 2007 05:54:01 +0000 |
| Subject: | Previous and Next Month and Year | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-257203@lists.php.net to get a copy of this message | ||
Hi,
RE: Previous and Next Month and YearThis is my code: $next_month = date('F Y', time()+$month); $prev_month = date('F Y', time()-$month); echo "$prev_month <br /> \n"; #Result "June 2007" echo "$next_month <br /> \n"; #Result "June 2007" What I am trying to do is get the month and year based upon a + or - $month value. The variable $month being "6" for the month of June of the present year of 2007. For example ($month -7) would be December 2006, and ($month +7) would be January 2006. Please help... Thank you. Keith