62,074
社区成员
发帖
与我相关
我的任务
分享
public static DateTime GetDateTime(object obj)
{
if (obj != null)
{
DateTime i_ret;
if (DateTime.TryParse(obj.ToString(), out i_ret))
{
return i_ret;
}
else
{
return DateTime.MinValue;
}
}
else
{
return DateTime.MinValue;
}
}
DateTime test = new DateTime();
string date = test == null ? string.Empty : test.ToShortDateString();