| Modifier and Type | Class and Description |
|---|---|
| private static class | TimeZoneProvider.
Time zone provider with offset. |
| pack-priv static class | TimeZoneProvider.
Time zone provider with time zone. |
| Modifier and Type | Field and Description |
|---|---|
| public static TimeZoneProvider[] | CACHE
A small cache for timezone providers. |
| private static final int | CACHE_SIZE
The number of cache elements (needs to be a power of 2). |
| public static final TimeZoneProvider | UTC
The UTC time zone provider. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static TimeZoneProvider | Returns: the time zone provider for the system default time zoneReturns the time zone provider for the system default time zone. |
| public abstract long | Returns: the epoch seconds valuedate value dateValue, long nanoseconds since midnight timeNanos)Calculates the epoch seconds from local date and time. |
| public abstract String | |
| public abstract String | Returns: the standard time name or daylight saving time name of the time zoneseconds since EPOCH epochSeconds)Get the standard time name or daylight saving time name of the time zone. |
| public abstract int | Returns: time zone offset in minutesdate value dateValue, long nanoseconds since midnight timeNanos)Calculates the time zone offset in seconds for the specified date value and nanoseconds since midnight in local time. |
| public abstract int | Returns: time zone offset in minutesseconds since EPOCH epochSeconds)Calculates the time zone offset in seconds for the specified EPOCH seconds. |
| public boolean | Returns: whether this is a simple time zone provider with a fixed offset from UTCReturns whether this is a simple time zone provider with a fixed offset from UTC. |
| public static TimeZoneProvider | |
| public static TimeZoneProvider | Returns: the time zone provider with the specified offsetUTC offset in seconds offset)Returns the time zone provider with the specified offset. |
| CACHE | back to summary |
|---|---|
| public static TimeZoneProvider[] CACHE A small cache for timezone providers. | |
| CACHE_SIZE | back to summary |
|---|---|
| private static final int CACHE_SIZE The number of cache elements (needs to be a power of 2). | |
| UTC | back to summary |
|---|---|
| public static final TimeZoneProvider UTC The UTC time zone provider. | |
| TimeZoneProvider | back to summary |
|---|---|
| public TimeZoneProvider() | |
| getDefault | back to summary |
|---|---|
| public static TimeZoneProvider getDefault() Returns the time zone provider for the system default time zone.
| |
| getEpochSecondsFromLocal | back to summary |
|---|---|
| public abstract long getEpochSecondsFromLocal(long dateValue, long timeNanos) Calculates the epoch seconds from local date and time.
| |
| getId | back to summary |
|---|---|
| public abstract String getId() Returns the ID of the time zone.
| |
| getShortId | back to summary |
|---|---|
| public abstract String getShortId(long epochSeconds) Get the standard time name or daylight saving time name of the time zone.
| |
| getTimeZoneOffsetLocal | back to summary |
|---|---|
| public abstract int getTimeZoneOffsetLocal(long dateValue, long timeNanos) Calculates the time zone offset in seconds for the specified date value and nanoseconds since midnight in local time.
| |
| getTimeZoneOffsetUTC | back to summary |
|---|---|
| public abstract int getTimeZoneOffsetUTC(long epochSeconds) Calculates the time zone offset in seconds for the specified EPOCH seconds.
| |
| hasFixedOffset | back to summary |
|---|---|
| public boolean hasFixedOffset() Returns whether this is a simple time zone provider with a fixed offset from UTC.
| |
| ofId | back to summary |
|---|---|
| public static TimeZoneProvider ofId(String id) throws RuntimeException Returns the time zone provider with the specified name.
| |
| ofOffset | back to summary |
|---|---|
| public static TimeZoneProvider ofOffset(int offset) Returns the time zone provider with the specified offset.
| |
| Modifier and Type | Field and Description |
|---|---|
| private volatile String | |
| private final int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. Indicates whether some other object is "equal to" this one. |
| public long | getEpochSecondsFromLocal(long
date value dateValue, long nanoseconds since midnight timeNanos)Implements abstract org. Calculates the epoch seconds from local date and time. |
| public String | |
| public String | getShortId(long
seconds since EPOCH epochSeconds)Implements abstract org. Get the standard time name or daylight saving time name of the time zone. |
| public int | getTimeZoneOffsetLocal(long
date value dateValue, long nanoseconds since midnight timeNanos)Implements abstract org. Calculates the time zone offset in seconds for the specified date value and nanoseconds since midnight in local time. |
| public int | getTimeZoneOffsetUTC(long
seconds since EPOCH epochSeconds)Implements abstract org. Calculates the time zone offset in seconds for the specified EPOCH seconds. |
| public boolean | hasFixedOffset()
Overrides org. Returns whether this is a simple time zone provider with a fixed offset from UTC. |
| public int | |
| public String |
| id | back to summary |
|---|---|
| private volatile String id | |
| offset | back to summary |
|---|---|
| private final int offset | |
| Simple | back to summary |
|---|---|
| pack-priv Simple(int offset) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getEpochSecondsFromLocal | back to summary |
|---|---|
| public long getEpochSecondsFromLocal(long dateValue, long timeNanos) Implements abstract org. Doc from org. Calculates the epoch seconds from local date and time.
| |
| getId | back to summary |
|---|---|
| public String getId() Implements abstract org. Doc from org. Returns the ID of the time zone. | |
| getShortId | back to summary |
|---|---|
| public String getShortId(long epochSeconds) Implements abstract org. Doc from org. Get the standard time name or daylight saving time name of the time zone. | |
| getTimeZoneOffsetLocal | back to summary |
|---|---|
| public int getTimeZoneOffsetLocal(long dateValue, long timeNanos) Implements abstract org. Doc from org. Calculates the time zone offset in seconds for the specified date value and nanoseconds since midnight in local time.
| |
| getTimeZoneOffsetUTC | back to summary |
|---|---|
| public int getTimeZoneOffsetUTC(long epochSeconds) Implements abstract org. Doc from org. Calculates the time zone offset in seconds for the specified EPOCH seconds.
| |
| hasFixedOffset | back to summary |
|---|---|
| public boolean hasFixedOffset() Overrides org. Doc from org. Returns whether this is a simple time zone provider with a fixed offset from UTC.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final long | SECONDS_PER_PERIOD
Number of seconds in 400 years. |
| pack-priv static final long | SECONDS_PER_YEAR
Number of seconds per year. |
| private static volatile DateTimeFormatter | |
| private final ZoneId |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. Indicates whether some other object is "equal to" this one. |
| public long | getEpochSecondsFromLocal(long
date value dateValue, long nanoseconds since midnight timeNanos)Implements abstract org. Calculates the epoch seconds from local date and time. |
| public String | |
| public String | getShortId(long
seconds since EPOCH epochSeconds)Implements abstract org. Get the standard time name or daylight saving time name of the time zone. |
| public int | getTimeZoneOffsetLocal(long
date value dateValue, long nanoseconds since midnight timeNanos)Implements abstract org. Calculates the time zone offset in seconds for the specified date value and nanoseconds since midnight in local time. |
| public int | getTimeZoneOffsetUTC(long
seconds since EPOCH epochSeconds)Implements abstract org. Calculates the time zone offset in seconds for the specified EPOCH seconds. |
| public int | |
| public String | |
| private static int | Returns: the specified year or the replacement year within the rangethe year year)Returns a year within the range -999,999,999..999,999,999 for the given year. |
| SECONDS_PER_PERIOD | back to summary |
|---|---|
| pack-priv static final long SECONDS_PER_PERIOD Number of seconds in 400 years. | |
| SECONDS_PER_YEAR | back to summary |
|---|---|
| pack-priv static final long SECONDS_PER_YEAR Number of seconds per year. | |
| TIME_ZONE_FORMATTER | back to summary |
|---|---|
| private static volatile DateTimeFormatter TIME_ZONE_FORMATTER | |
| zoneId | back to summary |
|---|---|
| private final ZoneId zoneId | |
| WithTimeZone | back to summary |
|---|---|
| pack-priv WithTimeZone(ZoneId timeZone) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getEpochSecondsFromLocal | back to summary |
|---|---|
| public long getEpochSecondsFromLocal(long dateValue, long timeNanos) Implements abstract org. Doc from org. Calculates the epoch seconds from local date and time.
| |
| getId | back to summary |
|---|---|
| public String getId() Implements abstract org. Doc from org. Returns the ID of the time zone. | |
| getShortId | back to summary |
|---|---|
| public String getShortId(long epochSeconds) Implements abstract org. Doc from org. Get the standard time name or daylight saving time name of the time zone. | |
| getTimeZoneOffsetLocal | back to summary |
|---|---|
| public int getTimeZoneOffsetLocal(long dateValue, long timeNanos) Implements abstract org. Doc from org. Calculates the time zone offset in seconds for the specified date value and nanoseconds since midnight in local time.
| |
| getTimeZoneOffsetUTC | back to summary |
|---|---|
| public int getTimeZoneOffsetUTC(long epochSeconds) Implements abstract org. Doc from org. Calculates the time zone offset in seconds for the specified EPOCH seconds.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| yearForCalendar | back to summary |
|---|---|
| private static int yearForCalendar(int year) Returns a year within the range -999,999,999..999,999,999 for the given year. Too large and too small years are replaced with years within the range using the 400 years period of the Gregorian calendar. Because we need them only to calculate a time zone offset, it's safe to normalize them to such range.
| |