Very simple to do just add or subtract to the current timestamp
When changing months + or - you just add or subtract
(2678400 * (Number of months))
For a year you would + or minus (31556908 * (Number of Years))
The two numbers
2678400 - Is the number of seconds in a day
31556908 - Number of seconds in a year.
For example a year would be
PHP Code:
// its 2009
$timestamp = 1254750653;
echo date('Y', $timestamp);
echo "\n";
// lets go to say... 2012
$yearPlus = $timestamp + (31556908 * 3);
echo date('Y', $yearPlus);
Month
PHP Code:
// its October
$timestamp = 1254750653;
echo date('M', $timestamp);
echo "\n";
// lets go to say... February
$monthPlus = $timestamp + (2678400 * 4);
// its now February!
echo date('Y', $monthPlus);
You could of course make the month calculations more accurate by using the number of days in each month for every month you advance ... but the most you will be off is +/- 3 days