/// <summary> /// get utc+8 当时时间 /// </summary> /// <returns></returns> public static DateTime GUTCA8() { string id = "China Standard Time"; DateTime rst = TryZoneTime(DateTime.Now,id); return rst; } public static DateTime TryZoneTime( DateTime time, string timeZoneId) { try { var timeZone = TimeZoneInfo.FindSystemTimeZoneById (timeZoneId); return TimeZoneInfo.ConvertTime(time, timeZone); } catch { } return time; }