I have a list of strings in this format:
my_strings = [
"10.02.20 time 09.24",
"06.02.20 time 08.51",
"10.02.20 time 09.24",
"10.02.20 time 09.25",
"10.02.20 time 09.26",
"10.02.20 time 09.27",
"10.02.20 time 09.28",
"10.02.20 time 09.29"
]
How can I sort them based on date and time, both normally and reversely? I think I should use something like:
my_strings.sort(key=lambda date: datetime.strptime(date, "%d-%b-%y"))
But this doesn't work.