110,538
社区成员
发帖
与我相关
我的任务
分享
DateTime dt = DateTime.Now;
string dtstring = dt.ToString();
Type type = typeof(DateTime);
TypeConverter tc = TypeDescriptor.GetConverter(type);
if (null != tc && tc.CanConvertFrom(typeof(string)))
{
DateTime dtnew = (DateTime)tc.ConvertFromString(dtstring);
MessageBox.Show(dtnew.ToString());
}