DateTimeOffset format: u
using System;
using System.Globalization;
using System.Threading;
public class Example
{
public static void Main()
{
DateTimeOffset outputDate = new DateTimeOffset(2010, 5, 31, 21, 0, 0, new TimeSpan(-8, 0, 0));
string specifier;
specifier = "u";
// Displays u: 2007-11-01 05:00:00Z
Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
}
}
//u: 2010-06-01 05:00:00Z
Related examples in the same category