unty获取系统时间

阅读更多
  public static uint GetLongTime()
        {
            DateTime time197011 = new DateTime(1970, 1, 1);
            DateTime time = DateTime.Now;
            TimeSpan ts = time - time197011;
            TimeZone localZone = TimeZone.CurrentTimeZone;
            TimeSpan off = localZone.GetUtcOffset(time);
            ts -= off;
            return (uint)ts.TotalSeconds;
        }

 

 

你可能感兴趣的:(unty获取系统时间)