Something I almost always do when pulling dates from a mySQL table is 
format the date column in the query itself using the mySQL function 
DATE_FORMAT()...


At 01:13 PM 4/6/01 +0100, Matt Davis wrote:
>Hi I am trying to format a date extracted from my DB. I have run my query
>and then have used the following to get my row data
>
>       while ($row = mysql_fetch_array($sql_result)) {
>                  $title = $row["message_title"];
>                  $message = $row["message"];
>                  $event = $row["date_of_event"];
>
>                  $shortevent = date ("D j M", $event);
>
>I am trying to take $event and make it diplay like this "FRI 06 APR" using
>the date function. Although $event outputs like this "2001-04-06 00:00:00"
>$shortevent outputs "Thu 1 Jan" which is unix epoch date.
>
>Does anybody know what I am doiing wrong its probably something really
>simple but I cant see what.
>
>Matt.
>
>
>--
>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