see if it works.
Note: strtotime() does the math, thats why it doesn't work, or at least
thats what i think is happening.
cheers,
- Sebastian
-Original Message-
From: shaun [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 4:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Increase
echo date("F"); // prints March
echo date("F", strtotime("month + 1")); // prints April
- Kevin
- Original Message -
From: "Boaz Yahav" <[EMAIL PROTECTED]>
To: "shaun" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent
: [EMAIL PROTECTED]
Subject: [PHP] Increase a month
Hi,
could someone tell me why this:
";
$month = $month + 1;
echo "\$month: ".date(F,strtotime($month))."";
?>
outputs this:
$month: March
$month: March
surely it should be:
$month: March
$month: April
Tha
For this exact instance (ie, trying to get the current month, and next
month) then all you need is:
Justin
on 21/03/03 1:00 AM, shaun ([EMAIL PROTECTED]) wrote:
> Hi,
>
> could someone tell me why this:
>
> $month = date(m);
> echo "\$month: ".date(F,strtotime($month))."";
> $month = $mon
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:
>
> $month = date(m);
>echo "\$month: ".date(F,strtot
Hi,
could someone tell me why this:
";
$month = $month + 1;
echo "\$month: ".date(F,strtotime($month))."";
?>
outputs this:
$month: March
$month: March
surely it should be:
$month: March
$month: April
Thanks in advance for your help.
--
PHP General Mailing List (http://www.php.net/
6 matches
Mail list logo