Reputation: 31
I would like to convert yyyy/mm/dd to dd/mm/yyyy format.So, I am using strtotime() function.but when I get zero date like(0000/00/00) from mysql. It will be showing wrong date like(01-01-1970).
I need exact string like 0000/00/00 to 00/00/0000. any other function are there?
Upvotes: 2
Views: 6937
Reputation: 62387
Try MySQL's DATE_FORMAT() function
SELECT DATE_FORMAT(dateColumn,'%d/%m/%Y') AS dateColumn FROM table...
Upvotes: 3