0

I have a form where the user has to insert a date but the date will appear correctly into the database only in this format yyyy-mm-dd. In any other form it will show 0000-00-00.

How can I change that to dd-mm-yyyy?

1 Answer 1

2

Use STR_TO_DATE in your insert query

insert into your_table (date_column)
values (STR_TO_DATE('14-08-2014','%d-%m-%Y'))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.