c# - How to sort a list of strings converted from nullable datetime -


i have list of strings have created nullable datetime objects. empty strings represent null entries. list can like

{ "23.06.2015", "", "01.07.2014", "" } 

i want sort list date descending. empty strings should @ bottom.

.orderbydescending(o => o.datestring) 

does wrong ordering. love use

.orderbydescending(o => datetime.parse(o.datestring)) 

but throw exception empty strings.

can format dates yyyymmdd rather dd.mm.yyyy? if can appear in numerical (also date) order when sort them.

once sorted, can convert them original dd.mm.yyyy format.


Comments