我有一个奇怪的问题:
string format = @"ddd MMM dd hh:mm:ss \G\M\Tzzz yyyy";
__timestamp = "Fri Apr 09 17:02:00 GMT-0500 2010";
DateTime.ParseExact(__timestamp, format, new CultureInfo("en"));
返回 FormatException
= "字符串无法被识别为有效的日期时间。"
但是该代码可以不出现异常:
string format = @"ddd MMM dd hh:mm:ss \G\M\Tzzz yyyy";
__timestamp = "Sat Apr 10 01:27:00 GMT-0500 2010";
DateTime.ParseExact(__timestamp, format, new CultureInfo("en"));
从按照该格式解析的30k个数据中,约有50%出现了该异常...
有人知道为什么吗?