예제 #1
0
        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);
        }
예제 #2
0
        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);
            }
        }