Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

sort a list of dates

Posted on 2006-06-21
2
Medium Priority
?
198 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 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
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 …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

722 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