Date takes a timestamp, so you would need to do something like this instead:

$mydate = strtotime('2002-05-02');
$tdate = date("d M Y", $mydate);
Echo $tdate;



I remember a man of some standing who once came to see me and told me that a
friend of his who claimed no small spiritual achievements had offended him;
"Who should go and make his peace with the other?" he asked. "I can not
answer your question," I replied, "as I cannot possibly set myself as a
judge between you, but one thing is certain to me; the meanest of the two of
you will wait for the other to make the move." The great man said no word,
but went forthwith to make his peace with his friend. - Unknown

> From: "Norman Zhang" <[EMAIL PROTECTED]>
> Date: Thu, 2 May 2002 12:17:57 -0700
> Subject: [PHP] date
> Hi,
> I am doing a test with the date function,
> $mydate="2002-05-02"
> $tdate=date("d M Y", "$mydate");
> echo "$tdate"
> I should expect 02 May 2002. But I get a strange result "31 Dec 1969". Why?
> How can I correct this?
> Regards,
> Norman
> -- 
> PHP General Mailing List (
> To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to