I need to order a list of elements by date.
This lamba function works well, but if two elements have the same date it doesn’t.
orderList.Sort((x, y) => y.Value.CreationDate.CompareTo(x.Value.CreationDate));
where CreationDate is a DateTime value.
Suppose, for example, that two elements have the same creation date (09/05/2011). I would be able to distinguish minute (or maybe seconds).
Thank you in advance.
DateTime already contains the hours, minutes and seconds. If they are not available in your CreationDate value, then there is nothing you can sort based on. If, in fact, the data is there, than you should have no problem sorting as it is.