|
Posted by drtebi on 11/27/06 03:54
The problem is very simple. You have the parameter order wrong for
mktime. It should be this:
$reqDate = date("Y-m-d", mktime(0, 0, 0, $m, $d, $y));
Cheers,
DrTebi
On Nov 26, 7:52 pm, l...@portcommodore.com wrote:
> laredotorn...@zipmail.com wrote:
> > Hi,
>
> > Using PHP 4.4.4 and I'm getting an odd time stamp attempting to make a
> > php date. Here's the code
>
> > $reqDate = date("Y-m-d", mktime(0, 0, 0, $y, $m, $d));
> > $reqDateTS = strtotime($reqDate);
>
> > If $y = 2006, $m = 12, and $d = 28, I get a negative value for
> > $reqDateTS. What is wrong with the above statement?
>
> > Thanks, - DaveDate functions in PHP can be tricky (DST, GMT, etc. shudder),
> did you read the manual on strtotime? It probably will help you.
>
> http://us3.php.net/strtotime
Navigation:
[Reply to this message]
|