Get the time zone for a specific exchange suffix

@param suffix suffix for the exchange in YahooFinance
@return time zone of the exchange
324508
public static TimeZone get(String suffix) {
        if(SUFFIX_TIMEZONES.containsKey(suffix)) {
            return SUFFIX_TIMEZONES.get(suffix);
        }
        log.warn("Cannot find time zone for exchange suffix: '{}'. Using default: America/New_York", suffix);
        return SUFFIX_TIMEZONES.get("");
    }
545824
public static Format getDateFormatter(final String pattern) {
		Format format = JKFormatUtil.formatMap.get(pattern);
		if (format == null) {
			format = new SimpleDateFormat(pattern);
			JKFormatUtil.formatMap.put(pattern, format);
		}
		return format;
	}
924268
public OffsetTime getInternalOffsetTime(ColumnInformation columnInfo, TimeZone timeZone)
      throws SQLException {
    if (lastValueWasNull()) {
      return null;
    }
    if (length == 0) {
      lastValueNull |= BIT_LAST_FIELD_NULL;
      return null;
    }

    ZoneId zoneId = timeZone.toZoneId().normalized();
    if (zoneId instanceof ZoneOffset) {
      ZoneOffset zoneOffset = (ZoneOffset) zoneId;

      int day = 0;
      int hour = 0;
      int minutes = 0;
      int seconds = 0;
      int microseconds = 0;

      switch (columnInfo.getColumnType().getSqlType()) {
        case Types.TIMESTAMP:
          int year = ((buf[pos] & 0xff) | (buf[pos + 1] & 0xff) << 8);
          int month = buf[pos + 2];
          day = buf[pos + 3];

          if (length > 4) {
            hour = buf[pos + 4];
            minutes = buf[pos + 5];
            seconds = buf[pos + 6];

            if (length > 7) {
              microseconds = ((buf[pos + 7] & 0xff)
                  + ((buf[pos + 8] & 0xff) << 8)
                  + ((buf[pos + 9] & 0xff) << 16)
                  + ((buf[pos + 10] & 0xff) << 24));
            }
          }

          return ZonedDateTime
              .of(year, month, day, hour, minutes, seconds, microseconds * 1000, zoneOffset)
              .toOffsetDateTime().toOffsetTime();

        case Types.TIME:

          final boolean negate = (buf[pos] & 0xff) == 0x01;

          if (length > 4) {
            day = ((buf[pos + 1] & 0xff)
                + ((buf[pos + 2] & 0xff) << 8)
                + ((buf[pos + 3] & 0xff) << 16)
                + ((buf[pos + 4] & 0xff) << 24));
          }

          if (length > 7) {
            hour = buf[pos + 5];
            minutes = buf[pos + 6];
            seconds = buf[pos + 7];
          }

          if (length > 8) {
            microseconds = ((buf[pos + 8] & 0xff)
                + ((buf[pos + 9] & 0xff) << 8)
                + ((buf[pos + 10] & 0xff) << 16)
                + ((buf[pos + 11] & 0xff) << 24));
          }

          return OffsetTime
              .of((negate ? -1 : 1) * (day * 24 + hour), minutes, seconds, microseconds * 1000,
                  zoneOffset);

        case Types.VARCHAR:
        case Types.LONGVARCHAR:
        case Types.CHAR:
          String raw = new String(buf, pos, length, StandardCharsets.UTF_8);
          try {
            return OffsetTime.parse(raw, DateTimeFormatter.ISO_OFFSET_TIME);
          } catch (DateTimeParseException dateParserEx) {
            throw new SQLException(raw
                + " cannot be parse as OffsetTime (format is \"HH:mm:ss[.S]\" with offset for data type \""
                + columnInfo.getColumnType() + "\")");
          }

        default:
          throw new SQLException("Cannot read " + OffsetTime.class.getName() + " using a "
              + columnInfo.getColumnType().getJavaTypeName() + " field");
      }
    }

    if (options.useLegacyDatetimeCode) {
      //system timezone is not an offset
      throw new SQLException(
          "Cannot return an OffsetTime for a TIME field when default timezone is '" + zoneId
              + "' (only possible for time-zone offset from Greenwich/UTC, such as +02:00)");
    }

    //server timezone is not an offset
    throw new SQLException(
        "Cannot return an OffsetTime for a TIME field when server timezone '" + zoneId
            + "' (only possible for time-zone offset from Greenwich/UTC, such as +02:00)");

  }
1218599
private String suffix(final String line) {
        for (int i = 0; i < line.length(); i++) {
            char c = line.charAt(i);
            if (c == ' ' || c == '\t') return line.substring(i + 1);
        }
        return "";
    }
215318
public String getItem(String itemName, String suffix) {
        return items.get(lookupItemName(itemName, suffix, false));
    }
1179492
public boolean endsWith(final BinaryString suffix) {
		ensureMaterialized();
		suffix.ensureMaterialized();
		return matchAt(suffix, sizeInBytes - suffix.sizeInBytes);
	}
369124
public static TimeZone timeZoneForName(String tzString) {
        // This is a horrible hack since there is no easier way to get a timezone
        // only if the string is recognized as a timezone.
        // The TimeZone.getTimeZone javadoc says the following:
        //   Returns:
        //       the specified TimeZone, or the GMT zone if the given ID cannot be
        //       understood.
        TimeZone tz = TimeZone.getTimeZone(tzString);
        if (tz.hasSameRules(BOGUS_TIMEZONE)) {
            // see if the user really was asking for GMT because if
            // TimeZone.getTimeZone can't recognize tzString, then that is what it
            // will return.
            Matcher m = UTC_TZID.matcher(tzString);
            if (m.matches()) {
                return TimeUtils.utcTimezone();
            }
            // unrecognizable timezone
            return null;
        }
        return tz;
    }
306992
def get_format_suffix(self, **kwargs):
        
        if self.settings.FORMAT_SUFFIX_KWARG:
            return kwargs.get(self.settings.FORMAT_SUFFIX_KWARG)
803143
public static String getMimeTypeByPath(String suffix) {
		while(suffix.startsWith(".") && suffix.length() > 0) {
			suffix = suffix.substring(1);
		}
		String mimeType = null;
		while((mimeType = findInMap(suffix)) == null) {
			int pos = suffix.indexOf('.');
			if(pos == -1) {
				break;
			}
			suffix = suffix.substring(pos+1);
		}
		return mimeType;
	}
256403
public final static DateFormat getTimeInstance(int style)
    {
        return get(style, 0, 1, Locale.getDefault(Locale.Category.FORMAT));
    }
410737
protected TimeZone fetchTimeZone(final String id) throws TimezonesException {
    final TaggedTimeZone ttz = fetchTimeZone(id, null);

    if (ttz == null) {
      return null;
    }

    register(id, ttz.tz);

    return ttz.tz;
  }
967722
private static String patternMatching(String ptnName, String input) {
		String suffix = "";
		if (ptnNumber == null)
			patternCompile();

		Matcher matcher;
		if (ptnName.equals("number")) {
			matcher = ptnNumber.matcher(input);
			if (matcher.matches())
				suffix = ":number";
		} else if (ptnName.equals("short_date")) {
			matcher = ptnShortDate.matcher(input);
			if (matcher.matches())
				suffix = ":short-date";
		} else if (ptnName.equals("long_date")) {
			matcher = ptnLongDate.matcher(input);
			if (matcher.matches())
				suffix = ":long-date";
		} else if (ptnName.equals("percentage")) {
			matcher = ptnPercentage.matcher(input);
			if (matcher.matches())
				suffix = ":percentage";
		} else if (ptnName.equals("currency")) {
			matcher = ptnCurrency.matcher(input);
			if (matcher.matches())
				suffix = ":currency";
			else {
				matcher = ptnViCurrency.matcher(input);
				if (matcher.matches()) {
					suffix = ":currency";
				}
			}
		}
		return suffix;
	}
284077
public ZonedDateTime getEndZonedDateTime() {
        if (zonedEndDateTime == null) {
            zonedEndDateTime = ZonedDateTime.of(endDate, endTime, zoneId);
        }

        return zonedEndDateTime;
    }
794871
public static Predicate<String> endsWith(final String suffix) {
		return new Predicate<String>() {
			@Override
			public boolean apply(final String input) {
				return input.endsWith(suffix);
			}
		};
	}
198144
public static ZonedDateTime zonedDateTimeOf(final String value) {
        try {
            return ZonedDateTime.parse(value);
        } catch (final Exception e) {
            return null;
        }
    }
511572
@Override
	public double getPaymentOffset(double fixingTime) {
		if(paymentOffsetCode == null) {
			return paymentOffset;
		}

		if(paymentOffsets.containsKey(fixingTime)) {
			return paymentOffsets.get(fixingTime);
		}
		else {
			/**
			 *  @TODO In case paymentDate is relevant for the index modeling, it should be checked
			 *  if the following derivation of paymentDate is accurate (e.g. wo we have a fixingOffset).
			 *  In such a case, this method may be overridden.
			 */
			LocalDate referenceDate = getReferenceDate();
			LocalDate fixingDate = FloatingpointDate.getDateFromFloatingPointDate(referenceDate, fixingTime);
			LocalDate paymentDate = paymentBusinessdayCalendar.getAdjustedDate(fixingDate, paymentOffsetCode, paymentDateRollConvention);
			double paymentTime = FloatingpointDate.getFloatingPointDateFromDate(referenceDate, paymentDate);
			paymentOffsets.put(fixingTime, paymentTime-fixingTime);
			return paymentTime-fixingTime;
		}
	}
975283
public static DateFormat[] getCFMLFormats(TimeZone tz, boolean lenient) {
	String id = "cfml-" + Locale.ENGLISH.toString() + "-" + tz.getID() + "-" + lenient;
	DateFormat[] df = formats.get(id);
	if (df == null) {
	    df = new SimpleDateFormat[] { new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.ENGLISH), new SimpleDateFormat("MMMM dd, yyyy HH:mm:ss a zzz", Locale.ENGLISH),
		    new SimpleDateFormat("MMM dd, yyyy HH:mm:ss a", Locale.ENGLISH), new SimpleDateFormat("MMM dd, yyyy HH:mm:ss", Locale.ENGLISH),
		    new SimpleDateFormat("MMMM d yyyy HH:mm:ssZ", Locale.ENGLISH), new SimpleDateFormat("MMMM d yyyy HH:mm:ss", Locale.ENGLISH),
		    new SimpleDateFormat("MMMM d yyyy HH:mm", Locale.ENGLISH), new SimpleDateFormat("EEE, MMM dd, yyyy HH:mm:ssZ", Locale.ENGLISH),
		    new SimpleDateFormat("EEE, MMM dd, yyyy HH:mm:ss", Locale.ENGLISH), new SimpleDateFormat("EEEE, MMMM dd, yyyy H:mm:ss a zzz", Locale.ENGLISH),
		    new SimpleDateFormat("dd-MMM-yy HH:mm a", Locale.ENGLISH), new SimpleDateFormat("dd-MMMM-yy HH:mm a", Locale.ENGLISH),
		    new SimpleDateFormat("EE, dd-MMM-yyyy HH:mm:ss zz", Locale.ENGLISH), new SimpleDateFormat("EE, dd MMM yyyy HH:mm:ss zz", Locale.ENGLISH),
		    new SimpleDateFormat("EEE d, MMM yyyy HH:mm:ss zz", Locale.ENGLISH), new SimpleDateFormat("dd-MMM-yyyy", Locale.ENGLISH),
		    new SimpleDateFormat("MMMM, dd yyyy HH:mm:ssZ", Locale.ENGLISH), new SimpleDateFormat("MMMM, dd yyyy HH:mm:ss", Locale.ENGLISH),
		    new SimpleDateFormat("yyyy/MM/dd HH:mm:ss zz", Locale.ENGLISH), new SimpleDateFormat("dd MMM yyyy HH:mm:ss zz", Locale.ENGLISH),
		    new SimpleDateFormat("EEE MMM dd yyyy HH:mm:ss 'GMT'ZZ (z)", Locale.ENGLISH), new SimpleDateFormat("dd MMM, yyyy HH:mm:ss", Locale.ENGLISH)
		    // ,new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss",Locale.ENGLISH)
	    };

	    for (int i = 0; i < df.length; i++) {
		df[i].setLenient(lenient);
		df[i].setTimeZone(tz);
	    }
	    formats.put(id, df);
	}
	return clone(df);
    }