1. 时间戳转 DateTime
static DateTime GetServerNow(ulong serverTime) { DateTime dateTimeStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); return dateTimeStart.AddSeconds(serverTime); }
时间: 2024-11-08 00:14:07
1. 时间戳转 DateTime
static DateTime GetServerNow(ulong serverTime) { DateTime dateTimeStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); return dateTimeStart.AddSeconds(serverTime); }