• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 200
  • Last Modified:

sort a list of dates

hello i have a sorted list containing 5 date items

i need to find out the earliest date


how can i sort the sorted list so it is earliest date first?


thanks
0
MrKevorkian
Asked:
MrKevorkian
1 Solution
 
dstanley9Commented:
What data structure are you using?  SortedList (if so, are you using the date as the key or the value)?  DateTime[]?  ArrayList?  List<DateTime>?  

For an array:

Array.Sort(myDateArray);

For an ArrayList:

myDateArrayList.Sort();

For a List<DateTime>:

myDateList.Sort();
0
 
MrKevorkianAuthor Commented:
cool  i didnt know about Array.Sort()
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now