Convert date format

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ifoel
    New Member
    • Jul 2007
    • 12

    #1

    Convert date format

    Hai All,

    Im beginer in Mysql.
    I have field's Date in MySql, with format "dd/mm/yyyy hh:mm:ss".
    How the syntax Select it and format change like this "yyyy-mm-dd hh:mm:ss"?



    Date
    04/07/2007 21:23:37

    Change to

    Date
    2007-07-04 21:23:37

    how to works

    thanks in advance
  • mwasif
    Recognized Expert Contributor
    • Jul 2006
    • 802

    #2
    It is your GUI which displaying date in the format 'dd/mm/yyyy hh:mm:ss'. MySQL date format is 'yyyy-mm-dd hh:mm:ss'

    To change the date format in SELECT statment, you can use DATE_FORMAT().

    Comment

    Working...