Solved

sort a list of dates

Posted on 2006-06-21
2
191 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 385 total points
Comment Utility
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
Comment Utility
cool  i didnt know about Array.Sort()
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now