public TimeZoneInfo GetTimeZone(Location location) { string ianaId = LocationIanaTimeZoneIds.GetIanaId(location); if (TimeZoneInfo.TryConvertIanaIdToWindowsId(ianaId, out string windowsTzId)) { return(TimeZoneInfo.FindSystemTimeZoneById(windowsTzId)); } throw new TimeZoneNotFoundException($"Time zone not found for {location}."); }
public TimeZoneInfo GetTimeZone(Location location) { string ianaId = LocationIanaTimeZoneIds.GetIanaId(location); return(TimeZoneInfo.FindSystemTimeZoneById(ianaId)); }