using System;
class Sample {
static void Main()
{
var dateTimeArray = new DateTime[] {
new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Local),
new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc),
new DateTime(2000, 1, 1, 6, 0, 0, DateTimeKind.Utc),
new DateTime(2000, 1, 1, 18, 0, 0, DateTimeKind.Utc),
new DateTime(2000, 1, 2, 0, 0, 0, DateTimeKind.Local),
new DateTime(2000, 1, 2, 0, 0, 0, DateTimeKind.Utc),
};
var dateTimeOffsetArray = new DateTimeOffset[] {
new DateTimeOffset(2000, 1, 1, 0, 0, 0, new TimeSpan( 0, 0, 0)),
new DateTimeOffset(2000, 1, 1, 0, 0, 0, new TimeSpan(-5, 0, 0)),
new DateTimeOffset(2000, 1, 1, 0, 0, 0, new TimeSpan(+9, 0, 0)),
new DateTimeOffset(2000, 1, 2, 0, 0, 0, new TimeSpan( 0, 0, 0)),
new DateTimeOffset(2000, 1, 2, 0, 0, 0, new TimeSpan(-5, 0, 0)),
new DateTimeOffset(2000, 1, 2, 0, 0, 0, new TimeSpan(+9, 0, 0)),
};
Array.Sort(dateTimeArray);
Array.Sort(dateTimeOffsetArray);
Console.WriteLine("DateTime");
foreach (var val in dateTimeArray) {
Console.WriteLine("{0,-35:o} ({1:o})", val, val.ToUniversalTime());
}
Console.WriteLine("DateTimeOffset");
foreach (var val in dateTimeOffsetArray) {
Console.WriteLine("{0,-35:o} ({1:o})", val, val.ToUniversalTime());
}
}
}