Here’s a quick snippet from MSDN that demonstrates how to format a date/time to UTC format with a timezone offset. (ISO 8601 compliant!)
DateTime date1 = new DateTime(2008, 4, 10, 6, 30, 0); DateTimeOffset dateOffset = new DateTimeOffset(date1, TimeZoneInfo.Local.GetUtcOffset(date1)); Console.Write(dateOffset.ToString("o"));
This will produce the following output:
2008-04-10T06:30:00.0000000-04:00
Everything you ever wanted to know and more about date and time formatting can be found here.