internal static ZoneId ParseZoneName(string zoneName) { ZoneId parsedName; try { parsedName = _zoneNameParser.parse(zoneName.Replace(' ', '_')).query(TemporalQueries.zoneId()); } catch (DateTimeParseException e) { throw new TemporalParseException("Invalid value for TimeZone: " + e.Message, e.ParsedString, e.ErrorIndex, e); } return(parsedName); }
public static ZoneId ParseZoneOffsetOrZoneName(string zoneName) { Matcher matcher = OFFSET.matcher(zoneName); if (matcher.matches()) { return(parseOffset(matcher)); } try { return(_zoneNameParser.parse(zoneName.Replace(' ', '_')).query(TemporalQueries.zoneId())); } catch (DateTimeParseException e) { throw new TemporalParseException("Invalid value for TimeZone: " + e.Message, e.ParsedString, e.ErrorIndex, e); } }