I have a problem ordering a mysql result by Date. The date is in this format: 15:24:57 - 21/04/2019 (24 hour clock)
I've tried this:
SELECT PlayerSteamID, BanLength, BanReason, AdminName, AdminSteamID, PlayerName, MapName, DateAndHour FROM BansList ORDER BY DateAndHour DESC
and this
SELECT PlayerSteamID, BanLength, BanReason, AdminName, AdminSteamID, PlayerName, MapName, DateAndHour FROM BansList ORDER BY UNIX_TIMESTAMP(STR_TO_DATE(DateAndHour, '%h:%i:%s - %d/%m/%Y')) DESC
But doesn't seem to work...
How can I make it so it's ordered by that date & time?
assuming your DateAndHour column is a string could be you need a proper conversion
SELECT PlayerSteamID
, BanLength
, BanReason
, AdminName
, AdminSteamID
, PlayerName
, MapName
, DateAndHour
FROM BansList
ORDER BY str_to_date(DateAndHour, '%T - %d/%m/%Y') DESC