I have a list of string lists containing DateTime values converted to strings. There are other values in the list, so I cannot make the list a complete DateTime list.
I have a line of code that sorts a list, but sorts dates by their string value, not by the DateTime value (this is what I want). How can I change my code to sort DateTime correctly?
List.Sort((a, b) => -1 * a[1].CompareTo(b[1]));
edit:
The contents of the list of samples:
Value1, 2010-06-28 10: 30: 00.000
Value2, 2010-06-27 10: 30: 00.000
Value2, 2010-06-26 10: 30: 00.000
source
share