How to convert the below string to DateTime in C#?
DateTime
Mon Apr 22 07:56:21 +0000 2013
When i tried the code with
string input = "Mon Apr 22 07:56:21 +0000 2013"; string format = "ffffd MMM dd HH:mm:ss +ffff yyyy"; DateTime dt; if(DateTime.TryParseExact(input,format, CultureInfo.InvariantCulture, DateTimeStyles.None,out dt)) { // do something with dt }