コード例 #1
0
 /// <summary>
 /// Returns the equivalent Universal Time (UTC) of this local date value.
 /// </summary>
 public static DateTime ToUniversal(this DateTime @this) =>
 @this.ToUniversal(sourceTimezone: LocalTime.CurrentTimeZone());
コード例 #2
0
 /// <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());
コード例 #3
0
 /// <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 @this) => @this.ToLocal(LocalTime.CurrentTimeZone());
コード例 #4
0
 /// <summary>
 /// Returns the equivalent Universal Time (UTC) of this local date value.
 /// </summary>
 public static DateTime ToUniversal(this DateTime localValue) =>
 localValue.ToUniversal(sourceTimezone: LocalTime.CurrentTimeZone());