// 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 = "Mon, 22 Mar 2010 03:52:22 -0700"; DateTime dt; if(DateTime.TryParseExact(s, "ddd, dd MMM yyyy HH:mm:ss zzz", new CultureInfo("en-US"),DateTimeStyles.AllowLeadingWhite | DateTimeStyles.AllowTrailingWhite, out dt)) { Console.WriteLine(dt); } else { Console.WriteLine("No luck"); } } } }