RE: [PHP] I have a mktime problem
| From: | Jay Blanchard | Date: | Thu, 30 Mar 2006 21:41:19 +0000 |
| Subject: | RE: [PHP] I have a mktime problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-232952@lists.php.net to get a copy of this message | ||
[snip]
I think this is happening because the day is being filled in by PHP as
30. Today is March 30th.
Try these:
echo date("d M Y", mktime(0,0,0,2)) . "\n"; //02 Mar 2006
echo date("d M Y", mktime(0,0,0,3)) . "\n"; //30 Mar 2006
PHP thinks you mean Feb 30th, which doesn't exist. So it adds 2 days and
ends up being Mar 2nd.
[/snip]
Thanks! That fixed it.