fix issue about timing convert.

This commit is contained in:
Tsanie 2021-08-06 17:25:29 +08:00
parent 9d316cba77
commit f8850073cd

View File

@ -99,13 +99,13 @@ namespace Gallery.Util
public static DateTime ToLocalTime(this long time)
{
//return new DateTime(1970, 1, 1, 0, 0, 0).AddMilliseconds(time).ToLocalTime();
return new DateTime(621355968000000000L + time * 10000).ToLocalTime();
return new DateTime(621355968000000000L + time * 10000000).ToLocalTime();
}
public static long ToTimestamp(this DateTime datetime)
{
var ticks = datetime.Ticks;
return (ticks - 621355968000000000L) / 10000;
return (ticks - 621355968000000000L) / 10000000;
}
}
}