TimeZoneIds is a utility class for operating with time zones.
This class is public only to be called from DynamicColumnSetterFactory and DynamicPageBuilder.
It is not guaranteed to use this class from plugins. This class may be moved, renamed, or removed.
A part of this class is reimplementation of Ruby v2.3.1's lib/time.rb. See its COPYING for license.
public static java.time.ZoneId convertJodaDateTimeZoneToZoneId(org.joda.time.DateTimeZone jodaDateTimeZone)
Converts org.joda.time.DateTimeZone to its corresponding java.time.ZoneID.
public static org.joda.time.DateTimeZone convertZoneOffsetToJodaDateTimeZone(java.time.ZoneOffset zoneOffset)
Converts java.time.ZoneOffset to its corresponding org.joda.time.DateTimeZone.
public static java.time.ZoneOffset parseRubyTimeZoneOffset(java.lang.String zoneId,
Parses a time zone ID to java.time.ZoneOffset basically in the same rule with Ruby v2.3.1's Time.strptime.
The only difference from Ruby v2.3.1's Time.strptime is that it does not consider local time zone.
If the given zone is neither numerical nor predefined textual time zones, it returns defaultZoneOffset then.
The method is reimplemented based on zone_offset from Ruby v2.3.1's lib/time.rb.
public static java.time.ZoneId parseZoneIdWithJodaAndRubyZoneTab(java.lang.String zoneId)
Parses time zone ID to java.time.ZoneId as compatible with the time zone parser of Embulk v0.8 as possible.
It recognizes time zone IDs in the following priority.
"Z" is always recognized as UTC in the first priority.
If the ID is "EST", "EDT", "CST", "CDT", "MST", "MDT", "PST", or "PDT", parsed by ZoneId.of with alias.
If the ID is "HST", "ROC", or recognized by ZoneId.of, it is parsed by ZoneId.of with alias.
Otherwise, the zone ID is recognized by Ruby-compatible zone tab.
If none of the above does not recognize the zone ID, it returns null.
Its time offset transitions in each time zone may be different from the time zone parser of Embulk v0.8,
but the difference is from their base time zone (tz) database. The difference is ignorable as time zone
database is continuously updated anyway.
public static org.joda.time.DateTimeZone parseJodaDateTimeZone(java.lang.String timeZoneName)