Converts the supplied DateTimeOffset to a String in the specified format.
using System; using System.Xml; class Example { static void Main() { DateTimeOffset dto; dto = DateTimeOffset.Now; String timeAsString = XmlConvert.ToString(dto, "yyyy-MM-ddTHH:mm:sszzzzzzz"); Console.WriteLine(timeAsString); } }