记录一下。时间戳
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;
}
7786

被折叠的 条评论
为什么被折叠?



