Here’s the string:
string date = "Fri Feb 17 15:50:42 +00:00 2012";
I’m just trying to parse it using:
DateTime.Parse(date, new Culture("en-us"));
DateTime.Parse(date);
No matter what I do it keeps coming back as invalid string.
What am I doing wrong?
I’d look into specifying the format you want using
ParseExact:If you want a DateTime use
DateTime.ParseExact:Or since you’re handling arbitrary offsets,
DateTimeOffsetis probably the better choice: