Thread: format date

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Posts
    3
    Rep Power
    0
    In MySQL database, a date field stores dates in YYYY-MM-DD format.
    When I do a select * for displaying in a table, I want to display the date in DD-MM-YYYY format...
    How? Can anybody tell how to convert?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Location
    Annapolis, Maryland US
    Posts
    113
    Rep Power
    16
    select date_format(date_field, '%Y-%m-%d') as FORMATTED from table_name

Similar Threads

  1. Sort by my date format
    By Mickster in forum PHP Development
    Replies: 5
    Last Post: February 19th, 2004, 02:33 PM
  2. Empty date & date format
    By anca in forum Visual Basic Programming
    Replies: 2
    Last Post: February 17th, 2004, 05:38 AM
  3. changing date format from 12/12/2002 to 12-12-2002
    By kimy_cool in forum PHP Development
    Replies: 5
    Last Post: September 19th, 2003, 03:35 PM
  4. importing to mysql | xls -> csv date format problem
    By jamesbond2002 in forum MySQL Help
    Replies: 2
    Last Post: August 29th, 2002, 09:21 AM
  5. What is the proper date format for a txt database?
    By jobesd in forum PHP Development
    Replies: 6
    Last Post: June 14th, 2001, 05:16 PM

IMN logo majestic logo threadwatch logo seochat tools logo