MonthName format from database

Discussion in 'PHP' started by babaMBA, Jul 25, 2007.

  1. #1
    My date is save in mysql database in default format "2007-12-20"

    i am using

    Select monthname(2007-12-20) and it will return "DECEMBER" but i want to the result as "DEC" only first three letters.

    Is it possible ........
     
    babaMBA, Jul 25, 2007 IP
  2. AsHinE

    AsHinE Well-Known Member

    Messages:
    240
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    138
    #2
    If you just want first 3 letter you can use
    
    substr();
    
    PHP:
    function.
    Or use can use
    
    strtr
    
    PHP:
    to convert long monthnames to short values
     
    AsHinE, Jul 26, 2007 IP