Ben,

    The easiest (and quickest) way I've done this in the past is to use
MySQL's DATE_FORMAT function when doing the SELECT. To format it like you
want try this:

    SELECT DATE_FORMAT(date_column, '%m/%d/%y') as f_date FROM Table_name;

    Be sure to use the correct name for the column that the date is stored
in.

    To get more info on the DATE_FORMAT function, check out the MySQL online
manual.

http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#Dat
e_and_time_functions

Regards,

Adam Younce
[EMAIL PROTECTED]

----- Original Message -----
From: "Ben Cairns" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 02, 2001 4:13 AM
Subject: [PHP-DB] Returning a formated dat


> I have a date stored in a MySQL field in a format like this:
>
> For example, 02/02/2001 (Today) would be stored as:
> 02022001
>
> What I need to do is to format that so that it looks like:
> 02/02/2001
>
> -- Ben Cairns - Head Of Technical Operations
> intasept.COM
> Tel: 01332 365333
> Fax: 01332 346010
> E-Mail: [EMAIL PROTECTED]
> Web: http://www.intasept.com
>
> "MAKING sense of
> the INFORMATION
> TECHNOLOGY age
> @ WORK......"
>
>
> --
> PHP Database 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 Database 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