Web Analytics Made Easy -
StatCounter How to Convert date format YYYY-MM-DD as MM-DD-YYYY - CodingForum

Announcement

Collapse
No announcement yet.

How to Convert date format YYYY-MM-DD as MM-DD-YYYY

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to Convert date format YYYY-MM-DD as MM-DD-YYYY

    Hi,

    Im trying to insert date in Mysql in the format MM/DD/YYYY. It gets stored in the table as YYYY-MM-DD. Now i need to retrieve back the format as MM-DD-YYYY. Plz help me out....

  • #2
    Wecome here!

    in a Mysql date column, you can only store it in the YYYY-MM-DD foremat.
    for representation to the end user, you can either use the mysql-function DATE_FORMAT() ( --> http://dev.mysql.com/doc/refman/4.1/...functions.html ) or use some function of your server side scripting language.
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

    Comment


    • #3
      Hi Guys,

      The following sql query could incorporate the change in date format. It goes
      select emp_Id, emp_Name, emp_Desg, date_format(emp_Doj,'%m/%d/%Y') from employee;

      Rgds,
      Leo

      Comment

      Working...
      X