場景
存取的時間戳數據爲:html
636728674347302002spa
怎樣將其轉換爲DateTime時間。3d
目前大多數的策略是,轉換成string,而後code
DateTime dateTimeStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); long lTime = long.Parse(timeStamp + "0000000"); TimeSpan toNow = new TimeSpan(lTime); dateTimeStart.Add(toNow);
試過,在Parse時提示int64過大或太小。htm
實現
DateTime dtStart2 = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(timeStamp));