unity 时间戳

来源:互联网 发布:爱国为主题的电影知乎 编辑:程序博客网 时间:2024/06/14 08:24

记录一下。时间戳
http://www.u3dc.com/archives/1696

void Update () {         //获取本地时间        //DateTime dt = DateTime.Now;        //m_LabelDayTime.text = string.Format(TableManager.self.GetInfoById(5257), dt.Year, dt.Month, dt.Day);        //获取服务器时间        uint time = (uint)LogicManager.self.m_SysTime;           m_LabelDayTime.text =ConverIntDataTime(time).ToString("yyyy 年 MM 月 dd 日 hh:mm:ss"); }//时间戳转换成年月日方法    public static System.DateTime ConverIntDataTime(uint d)    {        System.DateTime time = System.DateTime.MinValue;        System.DateTime stime = System.TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1, 0, 0, 0));        time = stime.AddSeconds(d);        return time;    }
0 0