--- Marc Henri <[EMAIL PROTECTED]> wrote:

> I have a table where I save the date. The format is
> "2005-07-19" in my table. I want to change the format
> to "19-07-2005" when on the screen for the user.
> 
> What is the best way to reformat the date?

The best way to format a date stored in MySQL is the DATE_FORMAT() function:

SELECT DATE_FORMAT(date_field, '%d-%m-%Y') AS date_field FROM table_name;

Clearly you will have to customize this.  However, I have used your preferred
date format.

James
_____


James D. Keeline
http://www.Keeline.com  http://www.Keeline.com/articles
http://Stratemeyer.org  http://www.Keeline.com/TSCollection

http://www.ITeachPHP.com -- Free Computer Classes: Linux, PHP, etc.
Summer Semester Begins Jun 20 -- New Classes Start Every Few Weeks.


Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to