Posted on: 1/21/2014 3:03:16 AM | Views : 621

since every computer setting is different, how to parse this datetime to en-GB format
as it has error
String datetimestring = "10/26/2013 12:00:00 AM"; Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB"); System.Globalization.CultureInfo cultureinfo = new System.Globalization.CultureInfo("en-GB"); DateTime result5= Convert.ToDateTime("1/1/1900"); Boolean dateerror = false; try { result5 = DateTime.Parse(datetimestring); } catch (System.Exception ex) { dateerror = true; } if (dateerror == true) { result5 = DateTime.Parse(datetimestring, cultureinfo); }

Go to the complete details ...