日期:2014-05-18  浏览次数:20691 次

"Thu Apr 19 14:56:45 +0800 2012"这样格式的字符串怎么转成DateTime类型
"Thu Apr 19 14:56:45 +0800 2012"这样格式的字符串怎么转成DateTime类型?

谢谢

------解决方案--------------------
string xx = "Thu Jul 28 10:00:00 UTC+0800 2005";
string[] cx = xx.Split(' ');
System.Globalization.DateTimeFormatInfo g = new System.Globalization.DateTimeFormatInfo();
g.LongDatePattern = "dd MMMM yyyy";
DateTime DT = DateTime.Parse(string.Format("{0} {1} {2} {3}", cx[2], cx[1], cx[5], cx[3]), g);
MessageBox.Show(DT.ToString());


结贴吧