大虾们:如何将"14 Dec 2006 at 00:51 (UTC)" format为时间格式
大虾们:如何将 "14 Dec 2006 at 00:51 (UTC) " format为时间格式
DateTimeFormatInfo di = new DateTimeFormatInfo();
di.LongDatePattern = "格式如何写????? ";
DateTime.Parse( "14 Dec 2006 at 00:51 (UTC) ", di);
------解决方案--------------------你可以先把 "14 Dec 2006 at 00:51 (UTC) " 转换成 "14 Dec 2006 00:51 " ,然后入下进行处理
IFormatProvider dtFormat = new CultureInfo( "en-US " );
string str= "14 Dec 2006 00:51 ";
DateTime dt = DateTime.ParseExact( str, "dd MMM yyyy HH:mm ", dtFormat );
MessageBox.Show( dt.ToString() );