I want to parse the following date format to a DateTime object in C#.
"19 Aug 2010 17:48:35 GMT+00:00"
How can I accomplish this?
I want to parse the following date format to a DateTime object in C#.
"19 Aug 2010 17:48:35 GMT+00:00"
How can I accomplish this?
I'd recommend using DateTime.ParseExact
.
DateTime.ParseExact(dateString, "dd MMM yyyy H:mm:ss \\G\\M\\Tzzz", System.Globalization.CultureInfo.InvariantCulture);
DateTime.Parse
pretty well to that effect - it accepted "March 1", "3\1\2013" and "03\01\2013" without issue.
– Matt DeKrey
Aug 2 '13 at 20:31