//传进一串数字的日期,返回DateTime(年月日时分秒)格式的日期:
public DateTime ConvertIntDatetime(double utc)
{
try
{
DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
startTime = startTime.AddSeconds(utc);
return startTime;
}
catch (Exception)
{
return DateTime.Parse("1979-01-01 00:00:00");
}
}
public DateTime ConvertIntDatetime(double utc)
{
try
{
DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
startTime = startTime.AddSeconds(utc);
return startTime;
}
catch (Exception)
{
return DateTime.Parse("1979-01-01 00:00:00");
}
}