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);
}
}