我该如何将以下日期字符串转换为dateTime:
Fri, 18 Dec 2009 9:38 am PST
我尝试使用
DateTime.Parse(string)
。我得到了以下错误:
The string was not recognized as a valid DateTime. There is an unknown word starting at index 25. System.SystemException {System.FormatException}
更新
我试图从 Yahoo 获取天气,并尝试获取日期的方法如下:
Date = DateTime.Parse(feed.Element(yWeatherNS + "condition").Attribute("date").Value),
我已经调试过了。日期属性是正确的(就像上面那样)。
谢谢。
DateTime.Parse
或者DateTime.ParseExact
吗? - huysentruitw