Package org.firebirdsql.gds.ng.tz
Class TimeZoneMapping
- java.lang.Object
-
- org.firebirdsql.gds.ng.tz.TimeZoneMapping
-
public final class TimeZoneMapping extends java.lang.ObjectMapping of Firebird time zone ids.- Since:
- 4.0
- Author:
- Mark Rotteveel
-
-
Constructor Summary
Constructors Constructor Description TimeZoneMapping()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TimeZoneMappinggetInstance()booleanisOffsetTimeZone(int timeZoneId)Determines iftimeZoneIdis an offset time zone or - possibly - a named time zone.booleanisSupportedOffsetTimezone(int timeZoneId)Determines iftimeZoneIdis an offset time zone in the range supported by Jaybird [-18:00, +18:00].java.time.ZoneIdtimeZoneById(int timeZoneId)Maps a Firebird time zone id to a suitable JavaZoneId.inttoOffsetMinutes(int timeZoneId)Return the offset in minutes for an offset time zone idinttoTimeZoneId(int offsetMinutes)Return the Firebird time zone id for an offset in minutes.inttoTimeZoneId(java.time.ZoneId zoneId)Returns the Firebird time zone id for aZoneId.inttoTimeZoneId(java.time.ZoneOffset zoneOffset)Returns the Firebird time zone id for aZoneOffset.
-
-
-
Method Detail
-
getInstance
public static TimeZoneMapping getInstance()
-
timeZoneById
public java.time.ZoneId timeZoneById(int timeZoneId)
Maps a Firebird time zone id to a suitable JavaZoneId.The returned value is either a named time zone (zone region), or an offset zone (
ZoneOffset).- Parameters:
timeZoneId- Firebird time zone id (valid between between 0 and 65535)- Returns:
java.time.Zoneequivalent (out of range values or unmapped ids will returnUTC).
-
isOffsetTimeZone
public boolean isOffsetTimeZone(int timeZoneId)
Determines iftimeZoneIdis an offset time zone or - possibly - a named time zone.- Parameters:
timeZoneId- Firebird time zone id- Returns:
trueif this is an offset time zone,falseotherwise
-
isSupportedOffsetTimezone
public boolean isSupportedOffsetTimezone(int timeZoneId)
Determines iftimeZoneIdis an offset time zone in the range supported by Jaybird [-18:00, +18:00].- Parameters:
timeZoneId- Firebird time zone id- Returns:
trueif this is an offset time zone in the range [-18:00, +18:00]
-
toOffsetMinutes
public int toOffsetMinutes(int timeZoneId)
Return the offset in minutes for an offset time zone id- Parameters:
timeZoneId- Offset time zone id (in range [0, 2878])- Returns:
- Offset in minutes, out of range values for
timeZoneIdwill return0for UTC/GMT.
-
toTimeZoneId
public int toTimeZoneId(java.time.ZoneOffset zoneOffset)
Returns the Firebird time zone id for aZoneOffset.- Parameters:
zoneOffset- The zone offset- Returns:
- Firebird time zone id
- See Also:
toTimeZoneId(ZoneId)
-
toTimeZoneId
public int toTimeZoneId(java.time.ZoneId zoneId)
Returns the Firebird time zone id for aZoneId.This method handles both
ZoneOffsetand named regions.- Parameters:
zoneId- The zone id- Returns:
- Firebird time zone id
- Since:
- 4.0.1
-
toTimeZoneId
public int toTimeZoneId(int offsetMinutes)
Return the Firebird time zone id for an offset in minutes.- Parameters:
offsetMinutes- Offset in minutes valid range [-1439, 1439] (or [-23:59, +23:59])- Returns:
- Time zone id encoding the specified offset, out of range values will return id for offset
0(UTC)
-
-