1

I am using phpmyadmin 4.8.3 running on Ubuntu 16.04.6 LTS with Mysql 14.14 Distrib 5.6.42. I wanted to change the default format yyyy-mm-dd to dd-mm-yyyy. Based on my research I can do this using "Default transformations for DateFormat" setting. However when I set the new "%d-%m-%Y" format in "Default transformations for DateFormat", it does not change the format of my existing date data or new inserted date. It remains with the yyyy-mm-dd. Is this a bug?

phpmyadmin DateFormat

Please help.

New contributor
Ali Ahmad is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
0

According to the manual at The DATE, DATETIME, and TIMESTAMP Types, the Y-m-d format is the only format that date fields use internally.

This is the format you must use when inserting data.

You can retrieve dates in whatever format you want:

SELECT DATE_FORMAT(date_field, '%d/%m/%Y')
  • Thanks for the reply. However according to this link [stackoverflow.com/questions/22827579/… it should work. By the way, if the sql command is like this "SELECT * FROM payment", how do I specify the DATE_FORMAT in that command? – Ali Ahmad Sep 12 at 2:32
  • These are browser transformation on the PHP side which do not affect the MySQL database in any way. The format for the query is "SELECT col1, col2, ... , DATE_FORMAT(date_field, '%d/%m/%Y'), ... FROM payment". – harrymc Sep 12 at 6:49

Your Answer

Ali Ahmad is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.