// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Globalization; namespace E { public class Program { public static void Main(string[] args) { string s = "2010-07-03T19:18:57+10:00"; DateTime dt = DateTime.ParseExact(s, "yyyy-MM-ddTHH:mm:sszzzz", null); Console.WriteLine(dt); DateTimeOffset dt2 = DateTimeOffset.Parse(s, null, DateTimeStyles.RoundtripKind); Console.WriteLine(dt2); } } }