Jump to content

[SOLVED] adding 1 to month


aebstract

Recommended Posts

Ok, have a look at the following and see if it makes sense;

 

<?php
$currentMonth = date("m",time());
echo date("F", mktime(0, 0, 0, $currentMonth, 0, 0));//prints the current month
echo "<br />";
echo date("F", mktime(0, 0, 0, ($currentMonth+1), 0, 0));//prints the next month
echo "<br />";
echo date("F", mktime(0, 0, 0, ($currentMonth-1), 0, 0));//prints the previous month
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.