/// <summary> /// 本区区时时间转换为格林威治区时时间 /// </summary> /// <param name="localTime">本区区时时间</param> /// <returns>格林威治区时时间</returns> private static DateTime LocalTimeToGreenwishTime(DateTime localTime) { TimeZone localTimeZone = TimeZone.CurrentTimeZone; TimeSpan timeSpan = localTimeZone.GetUtcOffset(localTime); DateTime greenwishTime = localTime - timeSpan; return greenwishTime; } /// <summary> /// 格林威治区时时间转换为本区区时时间 /// </summary> /// <param name="greenwishTime">格林威治区时时间</param> /// <returns>本区区时时间</returns> private static DateTime GreenwishTimeToLocalTime(DateTime greenwishTime) { TimeZone localTimeZone = System.TimeZone.CurrentTimeZone; TimeSpan timeSpan = localTimeZone.GetUtcOffset(greenwishTime); DateTime lacalTime = greenwishTime + timeSpan; return lacalTime; }