RE: I have a mktime problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[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.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux