Package org.h2.util
Class TimeZoneProvider.Simple
java.lang.Object
org.h2.util.TimeZoneProvider
org.h2.util.TimeZoneProvider.Simple
- Enclosing class:
TimeZoneProvider
Time zone provider with offset.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.h2.util.TimeZoneProvider
TimeZoneProvider.WithTimeZone -
Field Summary
FieldsFields inherited from class org.h2.util.TimeZoneProvider
CACHE, UTC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanlonggetEpochSecondsFromLocal(long dateValue, long timeNanos) Calculates the epoch seconds from local date and time.getId()Returns the ID of the time zone.getShortId(long epochSeconds) Get the standard time name or daylight saving time name of the time zone.intgetTimeZoneOffsetLocal(long dateValue, long timeNanos) Calculates the time zone offset in seconds for the specified date value and nanoseconds since midnight in local time.intgetTimeZoneOffsetUTC(long epochSeconds) Calculates the time zone offset in seconds for the specified EPOCH seconds.booleanReturns whether this is a simple time zone provider with a fixed offset from UTC.inthashCode()toString()Methods inherited from class org.h2.util.TimeZoneProvider
getDefault, ofId, ofOffset
-
Field Details
-
offset
private final int offset -
id
-
-
Constructor Details
-
Simple
Simple(int offset)
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
getTimeZoneOffsetUTC
public int getTimeZoneOffsetUTC(long epochSeconds) Description copied from class:TimeZoneProviderCalculates the time zone offset in seconds for the specified EPOCH seconds.- Specified by:
getTimeZoneOffsetUTCin classTimeZoneProvider- Parameters:
epochSeconds- seconds since EPOCH- Returns:
- time zone offset in minutes
-
getTimeZoneOffsetLocal
public int getTimeZoneOffsetLocal(long dateValue, long timeNanos) Description copied from class:TimeZoneProviderCalculates the time zone offset in seconds for the specified date value and nanoseconds since midnight in local time.- Specified by:
getTimeZoneOffsetLocalin classTimeZoneProvider- Parameters:
dateValue- date valuetimeNanos- nanoseconds since midnight- Returns:
- time zone offset in minutes
-
getEpochSecondsFromLocal
public long getEpochSecondsFromLocal(long dateValue, long timeNanos) Description copied from class:TimeZoneProviderCalculates the epoch seconds from local date and time.- Specified by:
getEpochSecondsFromLocalin classTimeZoneProvider- Parameters:
dateValue- date valuetimeNanos- nanoseconds since midnight- Returns:
- the epoch seconds value
-
getId
Description copied from class:TimeZoneProviderReturns the ID of the time zone.- Specified by:
getIdin classTimeZoneProvider- Returns:
- the ID of the time zone
-
getShortId
Description copied from class:TimeZoneProviderGet the standard time name or daylight saving time name of the time zone.- Specified by:
getShortIdin classTimeZoneProvider- Parameters:
epochSeconds- seconds since EPOCH- Returns:
- the standard time name or daylight saving time name of the time zone
-
hasFixedOffset
public boolean hasFixedOffset()Description copied from class:TimeZoneProviderReturns whether this is a simple time zone provider with a fixed offset from UTC.- Overrides:
hasFixedOffsetin classTimeZoneProvider- Returns:
- whether this is a simple time zone provider with a fixed offset from UTC
-
toString
-