|
Posted by Kimmo Laine on 11/27/06 08:21
<drtebi@gmail.com> wrote in message
news:1164599656.224112.279450@f16g2000cwb.googlegroups.com...
> 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);
>
> 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));
I don't get the double conversion... mktime already returns a unix
timestamp, so why pass the timestamp to date and then give the date again to
strtotime to make yet another timestamp, which is the exact same that mktime
returned... Simplify!
$reqDateTS = mktime(0, 0, 0, $d, $m, $y);
Remember KISS and LOVE:
Keep It Simple, Stupid. Leave Out Virtually Everything.
--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti pδivittyvδ nettisarjis
spam@outolempi.net | rot13(xvzzb@bhgbyrzcv.arg)
Navigation:
[Reply to this message]
|