int TimeShift(DateTime dt)
{
TimeSpan st = dt - new DateTime(1970, 1, 1, 0, 0, 0);
return Convert.ToInt32(st.TotalSeconds);
}
DateTime TimeShift(int s)
{
DateTime startTime = TimeZoneInfo.ConvertTime(new DateTime(1970, 1, 1, 0, 0, 0), TimeZoneInfo.Local);
DateTime dt = startTime.AddSeconds(s);
return dt;
}
【技巧】Unity关于时间戳
最新推荐文章于 2024-09-10 16:11:57 发布