tags:

views:

108

answers:

4

I get a json date from a webservice that i need to parse manualy and the date looks like this: "Fri, 06 Nov 2009 00:00:00 -0800"

How would i parse this into a datetime object?

I guess i should use DateTime.ParseExact but what do i feed into it.

+5  A: 

Just use DateTime.Parse. I verified it works for this string.

JaredPar
ok now im embarresed! thanks alot i didnt think it would be that easy!
Petoj
+2  A: 

var date = DateTime.Parse("Fri, 06 Nov 2009 00:00:00 -0800"); works fine.

alexn
A: 

Check it out: Converting String to DateTime C#.net

Rubens Farias
+1  A: 

I ran this code and it worked fine:

string date = "Fri, 06 Nov 2009 00:00:00 -0800";
DateTime dt = DateTime.Parse(date);
Pete OHanlon