using date_format as specified in the doc from mysql
select date_format('20-May-2013', '%d-%b-%Y');
returns null, why?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You are trying to parse a date using DATE_TIME(), but that function is meant to do the inverse – take a known formatted date and display it using a custom format. What you probably want is the STR_TO_DATE() function: