using System; using System.Collections.Generic;
class Program { static void Main(string[] args) { List<DateTime> l = new List<DateTime>();
l.Add(new DateTime(2008, 2, 24, 11, 32, 15));
l.Add(new DateTime(1808, 6, 12, 4, 0, 10));
l.Add(new DateTime(1908, 2, 24, 11, 32, 15));
l.Add(new DateTime(1945, 7, 6, 13, 0, 0));
l.Add(new DateTime(1619, 2, 24, 23, 32, 15));
l.Sort(new Comparison<DateTime>(
delegate (DateTime d1, DateTime d2)
{ return DateTime.Compare(d1, d2); }));
foreach(DateTime d in l)
{
Console.WriteLine(d);
}
Program.ConsoleKey();
}
static void ConsoleKey()
{
Console.WriteLine(
string.Format("{0}Press any key to continue...",
Environment.NewLine));
Console.ReadKey(false);
}
}