Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ FindSystemTimeZoneById()

static TimeZoneInfo System.TimeZoneInfo.FindSystemTimeZoneById ( string id)
inlinestatic

Definition at line 2515 of file TimeZoneInfo.cs.

2516 {
2517 if (string.Equals(id, "UTC", StringComparison.OrdinalIgnoreCase))
2518 {
2519 return Utc;
2520 }
2521 if (id == null)
2522 {
2523 throw new ArgumentNullException("id");
2524 }
2525 if (id.Length == 0 || id.Length > 255 || id.Contains('\0'))
2526 {
2527 throw new TimeZoneNotFoundException(SR.Format(SR.TimeZoneNotFound_MissingData, id));
2528 }
2529 CachedData cachedData = s_cachedData;
2532 Exception e;
2534 {
2536 }
2537 return timeZoneInfoResult switch
2538 {
2540 TimeZoneInfoResult.InvalidTimeZoneException => throw new InvalidTimeZoneException(SR.Format(SR.InvalidTimeZone_InvalidRegistryData, id), e),
2541 TimeZoneInfoResult.SecurityException => throw new SecurityException(SR.Format(SR.Security_CannotReadRegistryData, id), e),
2542 _ => throw new TimeZoneNotFoundException(SR.Format(SR.TimeZoneNotFound_MissingData, id), e),
2543 };
2544 }
static CachedData s_cachedData
static TimeZoneInfo Utc
TimeZoneInfo(string id, TimeSpan baseUtcOffset, string displayName, string standardDisplayName, string daylightDisplayName, AdjustmentRule[] adjustmentRules, bool disableDaylightSavingTime, bool hasIanaId=false)
bool Equals([NotNullWhen(true)] TimeZoneInfo? other)
static TimeZoneInfoResult TryGetTimeZone(string id, bool dstDisabled, out TimeZoneInfo value, out Exception e, CachedData cachedData, bool alwaysFallbackToLocalMachine=false)

References System.Runtime.Serialization.Dictionary, System.TimeZoneInfo.Equals(), System.SR.Format(), System.SR.InvalidTimeZone_InvalidRegistryData, System.TimeZoneInfo.InvalidTimeZoneException, System.TimeZoneInfo.s_cachedData, System.SR.Security_CannotReadRegistryData, System.TimeZoneInfo.SecurityException, System.SR.TimeZoneNotFound_MissingData, System.TimeZoneInfo.TimeZoneNotFoundException, System.TimeZoneInfo.TryGetTimeZone(), System.TimeZoneInfo.Utc, and System.value.

Referenced by System.TimeZoneInfo.ConvertTimeBySystemTimeZoneId(), System.TimeZoneInfo.ConvertTimeBySystemTimeZoneId(), and System.TimeZoneInfo.ConvertTimeBySystemTimeZoneId().