DateTimeOffset format: s
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 = "s";
Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
}
}
//s: 2010-05-31T21:00:00
Related examples in the same category