I have a list of dates as strings in the format 'dd/mm/yyyy hh:mm:ss tt' I'm trying to order them by closest to farthest like so:
09/12/2018 12:00:00 PM
10/12/2018 12:00:00 PM
11/12/2018 12:00:00 PM
My code seems to be ordering them from the 11th to the 09th which I don't want but can't seem to get right.
DateTime now = DateTime.Now;
var ordered = herds.HerdList.OrderBy(n => (now - DateTime.Parse(n.Date_Visit)).Duration());
The above code gives me:
11/12/2018 12:00:00 PM
10/12/2018 12:00:00 PM
09/12/2018 12:00:00 PM
How can I order it the other way around?
Thanks