utc时间戳 日期 转换
utc时间戳 日期 转换
public long ConvertDateTimeToInt(DateTime time) { DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1, 0, 0, 0, 0)); long t = (time.Ticks - startTime.Ticks) / 10000; //除10000调整为13位 return t; } private DateTime ConvertStringToDateTime(string timestamp) { DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); long lTime = long.Parse(timestamp + "0000"); TimeSpan toNow = new TimeSpan(lTime); return dtStart.Add(toNow); }