MySQL STR_TO_DATE function Date Format

Discussion in 'Databases' started by afridy, May 3, 2013.

  1. #1
    Hello,

    i have a date in my database column like this 2013/05/24
    i want to format it using STR_TO_DATE

    I want to know which syntax is correct below ?
    1.
    SELECT STR_TO_DATE('2013/05/24','%Y/%m/%d');  
    PHP:
    2.
    SELECT STR_TO_DATE('2013/05/24','%Y %m %d');  
    PHP:
     
    Last edited: May 3, 2013
    afridy, May 3, 2013 IP
  2. afridy

    afridy Well-Known Member

    Messages:
    810
    Likes Received:
    116
    Best Answers:
    0
    Trophy Points:
    135
    #2
    this question has been solved.
    correct syntax is 1.
     
    afridy, May 3, 2013 IP