ICU
TimeZone with additional methods to access
time zone transitions and rules. All ICU TimeZone concrete subclasses
extend this class. APIs added to java.util.TimeZone by
BasicTimeZone are annotated with '[icu]'.
com.ibm.icu.util.TimeZoneRule , com.ibm.icu.util.TimeZoneTransition
| Modifier and Type | Class and Description |
|---|---|
| public static enum |
| Modifier and Type | Field and Description |
|---|---|
| protected static final int | FORMER_LATTER_MASK
The bit mask for the former/latter option used by internal implementation. |
| protected static final int | LOCAL_DST
The time type option for daylight saving time used internally. |
| protected static final int | LOCAL_FORMER
The option designate former time used by internal implementation. |
| protected static final int | LOCAL_LATTER
The option designate latter time used by internal implementation. |
| protected static final int | LOCAL_STD
The time type option for standard time used by internal implementation. |
| private static final long | |
| private static final long | |
| protected static final int | STD_DST_MASK
The bit mask for the time type option used by internal implementation. |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | BasicTimeZone(String
the time zone ID. ID)
Deprecated
This API is ICU internal only.
Constructing a BasicTimeZone with the given time zone ID.
|
| Modifier and Type | Method and Description |
|---|---|
| protected static int | Returns: LocalOption's internal flag value.A LocalOption locOpt
Deprecated
This API is ICU internal only.
Get LocalOption's internal flag value.
|
| public abstract TimeZoneTransition | Returns: ADate holding the first time zone transition time
after the given base time, or null if no time zone transitions
are available after the base time.The base time. base, boolean Whether the base time is inclusive or not. inclusive)ICU |
| public void | getOffsetFromLocal(long date, BasicTimeZone.
ICU |
| public abstract TimeZoneTransition | Returns: ADate holding the last time zone transition time
before the given base time, or null if no time zone transitions
are available before the base time.The base time. base, boolean Whether the base time is inclusive or not. inclusive)ICU |
| public TimeZoneRule[] | Returns: The array ofTimeZoneRule, either a single
InitialTimeZoneRule object, or a pair of AnnualTimeZoneRule
with a single InitialTimeZoneRule. The first element in the
array is always a InitialTimeZoneRule.The date to be used for date)TimeZoneRule extraction.ICU |
| public abstract TimeZoneRule[] | |
| public TimeZoneRule[] | Returns: The array ofTimeZoneRule which represents this
time zone since the start time.The start time (inclusive). start)ICU |
| public boolean | Returns: true if the other time zone has the equivalent transitions in the time range. When tz is not aBasicTimeZone, this method
returns false.The instance of tz, long TimeZoneThe start time of the evaluated time range (inclusive) start, long The end time of the evaluated time range (inclusive) end)ICU |
| public boolean | Returns: true if the other time zone has the equivalent transitions in the time range. When tz is not aBasicTimeZone, this method
returns false.The instance of tz, long TimeZoneThe start time of the evaluated time range (inclusive) start, long The end time of the evaluated time range (inclusive) end, boolean When true, any transitions with only daylight saving amount
changes will be ignored, except either of them is zero. For example, a transition
from rawoffset 3:00/dstsavings 1:00 to rawoffset 2:00/dstsavings 2:00 is excluded
from the comparison, but a transition from rawoffset 2:00/dstsavings 1:00 to
rawoffset 3:00/dstsavings 0:00 is included. ignoreDstAmount)ICU |
| FORMER_LATTER_MASK | back to summary |
|---|---|
| protected static final int FORMER_LATTER_MASK
Deprecated This API is ICU internal only. The bit mask for the former/latter option used by internal implementation.
| |
| LOCAL_DST | back to summary |
|---|---|
| protected static final int LOCAL_DST
Deprecated This API is ICU internal only. The time type option for daylight saving time used internally.
| |
| LOCAL_FORMER | back to summary |
|---|---|
| protected static final int LOCAL_FORMER
Deprecated This API is ICU internal only. The option designate former time used by internal implementation.
| |
| LOCAL_LATTER | back to summary |
|---|---|
| protected static final int LOCAL_LATTER
Deprecated This API is ICU internal only. The option designate latter time used by internal implementation.
| |
| LOCAL_STD | back to summary |
|---|---|
| protected static final int LOCAL_STD
Deprecated This API is ICU internal only. The time type option for standard time used by internal implementation.
| |
| MILLIS_PER_YEAR | back to summary |
|---|---|
| private static final long MILLIS_PER_YEAR | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| STD_DST_MASK | back to summary |
|---|---|
| protected static final int STD_DST_MASK
Deprecated This API is ICU internal only. The bit mask for the time type option used by internal implementation.
| |
| BasicTimeZone | back to summary |
|---|---|
| protected BasicTimeZone() Protected no arg constructor.
| |
| BasicTimeZone | back to summary |
|---|---|
| protected BasicTimeZone(String ID)
Deprecated This API is ICU internal only. Constructing a BasicTimeZone with the given time zone ID. | |
| getLocalOptionValue | back to summary |
|---|---|
| protected static int getLocalOptionValue(BasicTimeZone. Deprecated This API is ICU internal only. Get
| |
| getNextTransition | back to summary |
|---|---|
| public abstract TimeZoneTransition getNextTransition(long base, boolean inclusive) ICU Example code:{@. jcite com.ibm.icu.samples.util.timezone.BasicTimeZoneExample:---getNextTransitionExample}
| |
| getOffsetFromLocal | back to summary |
|---|---|
| public void getOffsetFromLocal(long date, BasicTimeZone. ICU
| |
| getPreviousTransition | back to summary |
|---|---|
| public abstract TimeZoneTransition getPreviousTransition(long base, boolean inclusive) ICU Example code:{@. jcite com.ibm.icu.samples.util.timezone.BasicTimeZoneExample:---getPreviousTransitionExample}
| |
| getSimpleTimeZoneRulesNear | back to summary |
|---|---|
| public TimeZoneRule[] getSimpleTimeZoneRulesNear(long date) ICU TimeZoneRule which represents the rule of
this time zone object near the specified date. Some applications are not
capable to handle historic time zone rule changes. Also some applications
can only handle certain type of rule definitions. This method returns
either a single InitialTimeZoneRule if this time zone does not
have any daylight saving time within 1 year from the specified time, or a
pair of AnnualTimeZoneRule whose rule type is
DateTimeRule.DOW for date and DateTimeRule.WALL_TIME
for time with a single InitialTimeZoneRule representing the
initial time, when this time zone observes daylight saving time near the
specified date. Thus, the result may be only valid for dates around the
specified date.
| |
| getTimeZoneRules | back to summary |
|---|---|
| public abstract TimeZoneRule[] getTimeZoneRules() ICU TimeZoneRule which represents the rule
of this time zone object. The first element in the result array will
be the InitialTimeZoneRule instance for the initial rule.
The rest will be either AnnualTimeZoneRule or
TimeArrayTimeZoneRule instances representing transitions.
| |
| getTimeZoneRules | back to summary |
|---|---|
| public TimeZoneRule[] getTimeZoneRules(long start) ICU TimeZoneRule which represents the rule
of this time zone object since the specified start time. The first
element in the result array will be the InitialTimeZoneRule
instance for the initial rule. The rest will be either
AnnualTimeZoneRule or TimeArrayTimeZoneRule
instances representing transitions.
Example code:{@. jcite com.ibm.icu.samples.util.timezone.BasicTimeZoneExample:---getTimeZoneRulesExample}
| |
| hasEquivalentTransitions | back to summary |
|---|---|
| public boolean hasEquivalentTransitions(TimeZone tz, long start, long end) ICU Example code:{@. jcite com.ibm.icu.samples.util.timezone.BasicTimeZoneExample:---hasEquivalentTransitionsExample}
| |
| hasEquivalentTransitions | back to summary |
|---|---|
| public boolean hasEquivalentTransitions(TimeZone tz, long start, long end, boolean ignoreDstAmount) ICU
| |
ICU
getOffsetFromLocal(long, LocalOption, LocalOption, int[])
to specify how to interpret an input time when it does not exist, or when it is ambiguous,
around a time zone transition.
| Modifier and Type | Field and Description |
|---|---|
| public static final BasicTimeZone. | DAYLIGHT_FORMER
An input time is interpreted as daylight saving time when local time is switched to/from standard time. |
| public static final BasicTimeZone. | DAYLIGHT_LATTER
An input time is interpreted as daylight saving time when local time is switched to/from standard time. |
| private int | |
| public static final BasicTimeZone. | FORMER
An input time is always interpreted as local time before a time zone transition. |
| public static final BasicTimeZone. | LATTER
An input time is always interpreted as local time after a time zone transition. |
| public static final BasicTimeZone. | STANDARD_FORMER
An input time is interpreted as standard time when local time is switched to/from daylight saving time. |
| public static final BasicTimeZone. | STANDARD_LATTER
An input time is interpreted as standard time when local time is switched to/from daylight saving time. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static BasicTimeZone. | |
| public static BasicTimeZone. |
| DAYLIGHT_FORMER | back to summary |
|---|---|
| public static final BasicTimeZone. An input time is interpreted as daylight saving time when local time is switched to/from standard time. When both sides of a time zone transition are standard time, or daylight saving time, the local time before the transition is used.
| |
| DAYLIGHT_LATTER | back to summary |
|---|---|
| public static final BasicTimeZone. An input time is interpreted as daylight saving time when local time is switched to/from standard time. When both sides of a time zone transition are standard time, or daylight saving time, the local time after the transition is used.
| |
| flagVal | back to summary |
|---|---|
| private int flagVal | |
| FORMER | back to summary |
|---|---|
| public static final BasicTimeZone. An input time is always interpreted as local time before a time zone transition.
| |
| LATTER | back to summary |
|---|---|
| public static final BasicTimeZone. An input time is always interpreted as local time after a time zone transition.
| |
| STANDARD_FORMER | back to summary |
|---|---|
| public static final BasicTimeZone. An input time is interpreted as standard time when local time is switched to/from daylight saving time. When both sides of a time zone transition are standard time, or daylight saving time, the local time before the transition is used.
| |
| STANDARD_LATTER | back to summary |
|---|---|
| public static final BasicTimeZone. An input time is interpreted as standard time when local time is switched to/from daylight saving time. When both sides of a time zone transition are standard time, or daylight saving time, the local time after the transition is used.
| |
| LocalOption | back to summary |
|---|---|
| private LocalOption(int flagVal) | |
| valueOf | back to summary |
|---|---|
| public static BasicTimeZone. | |
| values | back to summary |
|---|---|
| public static BasicTimeZone. | |