ICU Enhancement
This class is ICU's replacement for java..
ICU
Methods, fields, and other functionality specific to ICU are labeled 'ICU'.
SimpleTimeZone is a concrete subclass of TimeZone
that represents a time zone for use with a Gregorian calendar. This
class does not handle historical changes.
Use a negative value for dayOfWeekInMonth to indicate that
SimpleTimeZone should count from the end of the month backwards. For
example, if Daylight Savings Time starts or ends at the last Sunday in a month, use
dayOfWeekInMonth = -1 along with dayOfWeek = Calendar.SUNDAY
to specify the rule.
Calendar, GregorianCalendar, TimeZone
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private int | |
| private transient AnnualTimeZoneRule | |
| private int | |
| private int | |
| private int | |
| private int | |
| private int | |
| private int | |
| private transient TimeZoneTransition | |
| private transient InitialTimeZoneRule | |
| private transient volatile boolean | |
| private int | |
| private static final long | |
| public static final int | STANDARD_TIME
Constant for a mode of start or end time specified as local standard time. |
| private int | |
| private int | |
| private int | |
| private int | |
| private int | |
| private int | |
| private int | |
| private static final byte[] | |
| private transient AnnualTimeZoneRule | |
| private transient boolean | |
| private boolean | |
| public static final int | UTC_TIME
Constant for a mode of start or end time specified as UTC. |
| public static final int | WALL_TIME
Constant for a mode of start or end time specified as local wall time. |
| private STZInfo |
| Access | Constructor and Description |
|---|---|
| public | SimpleTimeZone(int
The given base time zone offset to GMT. rawOffset, String The time zone ID which is obtained from
TimeZone.getAvailableIDs. ID)Constructs a SimpleTimeZone with the given base time zone offset from GMT and time zone ID. Timezone IDs can be obtained from TimeZone.getAvailableIDs. |
| public | SimpleTimeZone(int
The given base time zone offset to GMT. rawOffset, String The time zone ID which is obtained from
TimeZone.getAvailableIDs. ID, int The daylight savings starting month. Month is
0-based. eg, 0 for January. startMonth, int The daylight savings starting
day-of-week-in-month. Please see the member
description for an example. startDay, int The daylight savings starting day-of-week. Please
see the member description for an example. startDayOfWeek, int The daylight savings starting time in local wall
time, which is standard time in this case. Please see the
member description for an example. startTime, int The daylight savings ending month. Month is
0-based. eg, 0 for January. endMonth, int The daylight savings ending day-of-week-in-month.
Please see the member description for an example. endDay, int The daylight savings ending day-of-week. Please
see the member description for an example. endDayOfWeek, int The daylight savings ending time in local wall time,
which is daylight time in this case. Please see the
member description for an example. endTime)Constructs a SimpleTimeZone with the given base time zone offset from GMT, time zone ID, time to start and end the daylight time. |
| public | SimpleTimeZone(int
The given base time zone offset to GMT. rawOffset, String The time zone ID which is obtained from
TimeZone.getAvailableIDs. ID, int The daylight savings starting month. Month is
0-based. eg, 0 for January. startMonth, int The daylight savings starting
day-of-week-in-month. Please see the member
description for an example. startDay, int The daylight savings starting day-of-week. Please
see the member description for an example. startDayOfWeek, int The daylight savings starting time in local wall
time, which is standard time in this case. Please see the
member description for an example. startTime, int The mode of the start time specified by startTime. startTimeMode, int The daylight savings ending month. Month is
0-based. eg, 0 for January. endMonth, int The daylight savings ending day-of-week-in-month.
Please see the member description for an example. endDay, int The daylight savings ending day-of-week. Please
see the member description for an example. endDayOfWeek, int The daylight savings ending time in local wall time,
which is daylight time in this case. Please see the
member description for an example. endTime, int The mode of the end time specified by endTime. endTimeMode, int The amount of time in ms saved during DST. dstSavings)Constructs a SimpleTimeZone with the given base time zone offset from GMT, time zone ID, time and its mode to start and end the daylight time. |
| public | SimpleTimeZone(int
The given base time zone offset to GMT. rawOffset, String The time zone ID which is obtained from
TimeZone.getAvailableIDs. ID, int The daylight savings starting month. Month is
0-based. eg, 0 for January. startMonth, int The daylight savings starting
day-of-week-in-month. Please see the member
description for an example. startDay, int The daylight savings starting day-of-week. Please
see the member description for an example. startDayOfWeek, int The daylight savings starting time in local wall
time, which is standard time in this case. Please see the
member description for an example. startTime, int The daylight savings ending month. Month is
0-based. eg, 0 for January. endMonth, int The daylight savings ending day-of-week-in-month.
Please see the member description for an example. endDay, int The daylight savings ending day-of-week. Please
see the member description for an example. endDayOfWeek, int The daylight savings ending time in local wall time,
which is daylight time in this case. Please see the
member description for an example. endTime, int The amount of time in ms saved during DST. dstSavings)Constructor. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | |
| public TimeZone | cloneAsThawed()
Overrides com. Implements com. |
| private int | Returns: 1 if the date is after the rule date, -1 if the date is before the rule date, or 0 if the date is equal to the rule date.Compare a given date in the year to a rule. |
| private void | construct(int _raw, int _startMonth, int _startDay, int _startDayOfWeek, int _startTime, int _startTimeMode, int _endMonth, int _endDay, int _endDayOfWeek, int _endTime, int _endTimeMode, int _dst)
Internal construction method. |
| private void | |
| private void | |
| private void | |
| public boolean | Returns: true if obj is a SimpleTimeZone equivalent to thisthe reference object with which to compare. obj)Overrides com. |
| public TimeZone | freeze()
Overrides com. Implements com. |
| public int | Returns: the number of milliseconds the time is advanced with respect to standard time when the daylight savings rules are in effect. Typically one hour (3600000). The amount could be negative, but not 0.Overrides com. |
| public TimeZoneTransition | getNextTransition(long
The base time. base, boolean Whether the base time is inclusive or not. inclusive)Implements abstract com. ICU |
| public int | getOffset(int
the era of the given date. era, int the year in the given date. year, int the month in the given date.
Month is 0-based. e.g., 0 for January. month, int the day-in-month of the given date. day, int the day-of-week of the given date. dayOfWeek, int the millis in day in standard local time. millis)Implements abstract com. |
| public int | getOffset(int era, int year, int month, int day, int dayOfWeek, int millis, int monthLength)
Deprecated
This API is ICU internal only.
|
| private int | getOffset(int era, int year, int month, int day, int dayOfWeek, int millis, int monthLength, int prevMonthLength)
|
| public void | getOffsetFromLocal(long date, BasicTimeZone.
Overrides com. ICU |
| public TimeZoneTransition | getPreviousTransition(long
The base time. base, boolean Whether the base time is inclusive or not. inclusive)Implements abstract com. ICU |
| public int | Returns: the raw offsetImplements abstract com. |
| private STZInfo | |
| public TimeZoneRule[] | |
| public int | Returns: a hash code value for this object.Overrides com. |
| public boolean | Returns: true if the given zone has the same rules and offset as this onethe TimeZone object to be compared with othr)Overrides com. |
| private boolean | |
| public boolean | inDaylightTime(Date
the given Date. date)Implements abstract com. |
| private synchronized void | |
| public boolean | isFrozen()
Overrides com. Implements com. |
| public boolean | observesDaylightTime()
Queries if this time zone is in daylight saving time or will observe
daylight saving time at any future time.
|
| private void | |
| public void | setDSTSavings(int
the number of milliseconds the time is
advanced with respect to standard time when the daylight savings rules
are in effect. Typically one hour (+3600000). The amount could be negative,
but not 0. millisSavedDuringDST)Sets the amount of time in ms that the clock is advanced during DST. |
| public void | setEndRule(int
The daylight savings ending month. Month is
0-based. eg, 0 for January. month, int The daylight savings ending
day-of-week-in-month. Please see the member
description for an example. dayOfWeekInMonth, int The daylight savings ending day-of-week. Please
see the member description for an example. dayOfWeek, int The daylight savings ending time in local wall time,
which is daylight time in this case. Please see the
member description for an example. time)Sets the daylight savings ending rule. |
| public void | setEndRule(int
The month in which this rule occurs (0-based). month, int The date in that month (1-based). dayOfMonth, int The time of that day (number of millis after midnight)
when DST ends in local wall time, which is daylight
time in this case. time)Sets the DST end rule to a fixed date within a month. |
| public void | setEndRule(int
The month in which this rule occurs (0-based). month, int A date within that month (1-based). dayOfMonth, int The day of the week on which this rule occurs. dayOfWeek, int The time of that day (number of millis after midnight)
when DST ends in local wall time, which is daylight
time in this case. time, boolean If true, this rule selects the first dayOfWeek on
or after dayOfMonth. If false, this rule selects
the last dayOfWeek on or before dayOfMonth. after)Sets the DST end rule to a weekday before or after a give date within a month, e.g., the first Monday on or after the 8th. |
| private void | |
| private void | setEndRule(int
the daylight savings ending month. Month is 0-based.
eg, 0 for January. month, int the daylight savings ending
day-of-week-in-month. See setStartRule() for a complete explanation. dayOfWeekInMonth, int the daylight savings ending day-of-week. See setStartRule()
for a complete explanation. dayOfWeek, int the daylight savings ending time. Please see the member
description for an example. time, int mode)Sets the daylight savings ending rule. |
| public void | setID(String
the new time zone ID. ID)Overrides com. |
| public void | setRawOffset(int
the raw offset of the time zone offsetMillis)Implements abstract com. |
| public void | setStartRule(int
The daylight savings starting month. Month is
0-based. eg, 0 for January. month, int The daylight savings starting
day-of-week-in-month. Please see the member
description for an example. dayOfWeekInMonth, int The daylight savings starting day-of-week.
Please see the member description for an
example. dayOfWeek, int The daylight savings starting time in local wall
time, which is standard time in this case. Please see
the member description for an example. time)Sets the daylight savings starting rule. |
| private void | setStartRule(int
the daylight savings starting month. Month is 0-based.
eg, 0 for January. month, int the daylight savings starting
day-of-week-in-month. Please see the member description for an example. dayOfWeekInMonth, int the daylight savings starting day-of-week. Please see
the member description for an example. dayOfWeek, int the daylight savings starting time. Please see the member
description for an example. time, int mode)Sets the daylight savings starting rule. |
| public void | setStartRule(int
The month in which this rule occurs (0-based). month, int The date in that month (1-based). dayOfMonth, int The time of that day (number of millis after midnight)
when DST takes effect in local wall time, which is
standard time in this case. time)Sets the DST start rule to a fixed date within a month. |
| public void | setStartRule(int
The month in which this rule occurs (0-based). month, int A date within that month (1-based). dayOfMonth, int The day of the week on which this rule occurs. dayOfWeek, int The time of that day (number of millis after midnight)
when DST takes effect in local wall time, which is
standard time in this case. time, boolean If true, this rule selects the first dayOfWeek on
or after dayOfMonth. If false, this rule selects
the last dayOfWeek on or before dayOfMonth. after)Sets the DST start rule to a weekday before or after a give date within a month, e.g., the first Monday on or after the 8th. |
| public void | |
| public String | Returns: a string representation of this objectOverrides java. |
| public boolean | useDaylightTime()
Implements abstract com. |