// 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 = "Thur 11/02/2006 9:05:52 PM"; CultureInfo ci = (CultureInfo)CultureInfo.CurrentCulture.Clone(); DateTimeFormatInfo dtf = (DateTimeFormatInfo)ci.DateTimeFormat.Clone(); dtf.AbbreviatedDayNames = new string[] { "Sund", "Mond", "Tues", "Wedn", "Thur", "Frid", "Satu" }; dtf.DateSeparator = "/"; dtf.TimeSeparator = ":"; dtf.AMDesignator = "AM"; dtf.PMDesignator = "PM"; ci.DateTimeFormat = dtf; DateTime dt = DateTime.ParseExact(s, "ddd M/d/yyyy h:mm:ss tt", ci); Console.WriteLine(dt); } } }