Previous and Next Month and Year

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

RE: Previous and Next Month and Year
This 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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux