Re: Increase a month
| From: | Joshua Moore-Oliva | Date: | Thu, 20 Mar 2003 13:59:51 +0000 |
| Subject: | Re: Increase a month | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-140431@lists.php.net to get a copy of this message | ||
date() returns a unix timestamp, which is in seconds. You are only adding one
second.
Try using mktime, and increment hte month argument there.
Josh.
On March 20, 2003 09:00 am, shaun wrote:
> Hi,
>
> could someone tell me why this:
>
> <?php
> $month = date(m);
> echo "\$month: ".date(F,strtotime($month))."<br>";
> $month = $month + 1;
> echo "\$month: ".date(F,strtotime($month))."<br>";
> ?>
>
> outputs this:
>
> $month: March
> $month: March
>
> surely it should be:
>
> $month: March
> $month: April
>
> Thanks in advance for your help.