TimeZone.CurrentTimeZone.ToLocalTime
/// <summary> /// 时间戳转为C#格式时间 /// </summary> /// <param name="timeStamp">Unix时间戳格式</param> /// <returns>C#格式时间</returns> public static DateTime GetTime(string timeStamp) { DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); long lTime = long.Parse(timeStamp + "0000000"); TimeSpan toNow = new TimeSpan(lTime); return dtStart.Add(toNow); }