Try using the DATE_FORMAT() function within your SQL query string...

$query = "SELELCT DATE_FORMAT (your_date_column, '%M %d %Y') FROM
your_table";

where:
%M is the month in full text
%d is the numerical day of the month with leading zeros
%Y is the four digit year

Extract the results as ussual... mysql_fetch_row() or mysql_fetch_array() or
whatever you would use.  Let me know if this works becuase I've not tried it
before.  Seems like it should work though.  Good luck.  :-)

-Kevin Stone

----- Original Message -----
From: "phantom" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 10, 2001 8:35 PM
Subject: [PHP] Date formatting


> What would be an easy what to format a date value into month day year??
> I want to specially display a date stored in mysql in date format
> YYYY-MM-DD
>
> The manual says: string date (string format, int [timestamp])
>
> I tried $FormattedDate = date("F y, Y",${StoredDate})
>
> 1999-04-15 spit out December 31, 1969 when I had hoped for April 15,
> 1999.
>
> Apparently YYYY-MM-DD is not a valid timestamp... i tried mysql formats
> of timestamp(8) and timestamp(14) and that didn't work either
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to