Solved

sort a list of dates

Posted on 2006-06-21
2
197 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 25

Accepted Solution

by:
dstanley9 earned 385 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

623 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