/// <summary> /// Returns the equivalent Universal Time (UTC) of this local date value. /// </summary> public static DateTime ToUniversal(this DateTime localValue) { return(localValue.ToUniversal(sourceTimezone: LocalTime.CurrentTimeZone())); }
/// <summary> /// Returns the local time equivalent of this UTC date value based on the TimeZone specified in Localtime.CurrentTimeZone(). /// Use this instead of ToLocalTime() so you get control over the TimeZone. /// </summary> public static DateTime ToLocal(this DateTime utcValue) => utcValue.ToLocal(LocalTime.CurrentTimeZone());