Question

How can I order in MySQL a column with date values like this "06:21, 28 February 2014"?

Was it helpful?

Solution

Use STR_TO_DATE() to convert it into a date first and then sort by it:

SELECT STR_TO_DATE(datecol, "%H:%i, %d %M %Y") AS newdate
-- ...
ORDER BY newdate DESC
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top