Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

sort a list of dates

Posted on 2006-06-21
2
Medium Priority
?
199 Views
Last Modified: 2010-04-16
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
Comment
Question by:MrKevorkian
2 Comments
 
LVL 25

Accepted Solution

by:
dstanley9 earned 1540 total points
ID: 16952519
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
 
LVL 1

Author Comment

by:MrKevorkian
ID: 16952690
cool  i didnt know about Array.Sort()
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Integration Management Part 2

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question