|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.icu.util.TimeZone
com.ibm.icu.impl.JDKTimeZone
com.ibm.icu.util.SimpleTimeZone
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, Daylight Savings Time ends at the last
(dayOfWeekInMonth = -1) Sunday in October, at 2 AM in standard time.
Calendar
,
GregorianCalendar
,
TimeZone
,
Serialized FormField Summary |
Fields inherited from class com.ibm.icu.impl.JDKTimeZone |
zone |
Fields inherited from class com.ibm.icu.util.TimeZone |
LONG, MILLIS_PER_DAY, MILLIS_PER_HOUR, SHORT |
Constructor Summary | |
SimpleTimeZone(int rawOffset,
java.lang.String ID)
Constructs a SimpleTimeZone with the given base time zone offset from GMT and time zone ID. |
|
SimpleTimeZone(int rawOffset,
java.lang.String ID,
int startMonth,
int startDay,
int startDayOfWeek,
int startTime,
int endMonth,
int endDay,
int endDayOfWeek,
int endTime)
Construct a SimpleTimeZone with the given base time zone offset from GMT, time zone ID, time to start and end the daylight time. |
|
SimpleTimeZone(int rawOffset,
java.lang.String ID,
int startMonth,
int startDay,
int startDayOfWeek,
int startTime,
int endMonth,
int endDay,
int endDayOfWeek,
int endTime,
int dstSavings)
Constructor. |
|
SimpleTimeZone(int raw,
java.lang.String ID,
int startMonth,
int startDay,
int startDayOfWeek,
int startTime,
int startTimeMode,
int endMonth,
int endDay,
int endDayOfWeek,
int endTime,
int endTimeMode,
int dst)
|
|
SimpleTimeZone(java.util.SimpleTimeZone tz,
java.lang.String ID)
Constructs a SimpleTimeZone that wraps the given java.util.SimpleTimeZone. |
Method Summary | |
java.lang.Object |
clone()
Return a clone of this time zone. |
boolean |
equals(java.lang.Object obj)
Return true if obj is a SimpleTimeZone equivalent to this. |
int |
getDSTSavings()
Returns the amount of time in ms that the clock is advanced during DST. |
int |
getOffset(int era,
int year,
int month,
int day,
int dayOfWeek,
int millis)
TimeZone API; calls through to wrapped time zone. |
int |
getOffset(int era,
int year,
int month,
int day,
int dayOfWeek,
int millis,
int monthLength)
|
int |
getRawOffset()
get the raw offset. |
int |
hashCode()
Return the hash code. |
boolean |
hasSameRules(TimeZone othr)
TimeZone API. |
boolean |
inDaylightTime(java.util.Date date)
TimeZone API; calls through to wrapped time zone. |
void |
setDSTSavings(int millisSavedDuringDST)
Sets the amount of time in ms that the clock is advanced during DST. |
void |
setEndRule(int month,
int dayOfMonth,
int time)
Sets the DST end rule to a fixed date within a month. |
void |
setEndRule(int month,
int dayOfWeekInMonth,
int dayOfWeek,
int time)
Sets the daylight savings ending rule. |
void |
setEndRule(int month,
int dayOfMonth,
int dayOfWeek,
int time,
boolean 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. |
void |
setRawOffset(int offsetMillis)
Set the raw offset. |
void |
setStartRule(int month,
int dayOfMonth,
int time)
Sets the DST start rule to a fixed date within a month. |
void |
setStartRule(int month,
int dayOfWeekInMonth,
int dayOfWeek,
int time)
Sets the daylight savings starting rule. |
void |
setStartRule(int month,
int dayOfMonth,
int dayOfWeek,
int time,
boolean 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. |
void |
setStartYear(int year)
Sets the daylight savings starting year. |
java.lang.String |
toString()
Returns a string representation of this object. |
boolean |
useDaylightTime()
TimeZone API; calls through to wrapped time zone. |
Methods inherited from class com.ibm.icu.impl.JDKTimeZone |
getOffset, setID, wrap |
Methods inherited from class com.ibm.icu.util.TimeZone |
countEquivalentIDs, getAvailableIDs, getAvailableIDs, getAvailableIDs, getDefault, getDisplayName, getDisplayName, getDisplayName, getDisplayName, getDisplayName, getDisplayName, getEquivalentID, getID, getOffset, getTimeZone, setDefault |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SimpleTimeZone(int rawOffset, java.lang.String ID)
rawOffset
- The given base time zone offset to GMT.ID
- The time zone ID which is obtained from
TimeZone.getAvailableIDs.public SimpleTimeZone(int rawOffset, java.lang.String ID, int startMonth, int startDay, int startDayOfWeek, int startTime, int endMonth, int endDay, int endDayOfWeek, int endTime)
rawOffset
- The given base time zone offset to GMT.ID
- The time zone ID which is obtained from
TimeZone.getAvailableIDs.startMonth
- The daylight savings starting month. Month is
0-based. eg, 0 for January.startDay
- The daylight savings starting
day-of-week-in-month. Please see the member
description for an example.startDayOfWeek
- The daylight savings starting day-of-week. Please
see the member description for an example.startTime
- The daylight savings starting time in local wall
time, which is standard time in this case. Please see the
member description for an example.endMonth
- The daylight savings ending month. Month is
0-based. eg, 0 for January.endDay
- The daylight savings ending day-of-week-in-month.
Please see the member description for an example.endDayOfWeek
- The daylight savings ending day-of-week. Please
see the member description for an example.endTime
- The daylight savings ending time in local wall time,
which is daylight time in this case. Please see the
member description for an example.
java.lang.IllegalArgumentException
- the month, day, dayOfWeek, or time
parameters are out of range for the start or end rulepublic SimpleTimeZone(int rawOffset, java.lang.String ID, int startMonth, int startDay, int startDayOfWeek, int startTime, int endMonth, int endDay, int endDayOfWeek, int endTime, int dstSavings)
dstSavings
- The amount of time in ms saved during DST.
java.lang.IllegalArgumentException
- the month, day, dayOfWeek, or time
parameters are out of range for the start or end rulepublic SimpleTimeZone(java.util.SimpleTimeZone tz, java.lang.String ID)
public SimpleTimeZone(int raw, java.lang.String ID, int startMonth, int startDay, int startDayOfWeek, int startTime, int startTimeMode, int endMonth, int endDay, int endDayOfWeek, int endTime, int endTimeMode, int dst)
Method Detail |
public void setRawOffset(int offsetMillis)
offsetMillis
- the raw offset of the time zonepublic int getRawOffset()
public void setStartYear(int year)
year
- The daylight savings starting year.public void setStartRule(int month, int dayOfWeekInMonth, int dayOfWeek, int time)
month
- The daylight savings starting month. Month is
0-based. eg, 0 for January.dayOfWeekInMonth
- The daylight savings starting
day-of-week-in-month. Please see the member
description for an example.dayOfWeek
- The daylight savings starting day-of-week.
Please see the member description for an
example.time
- The daylight savings starting time in local wall
time, which is standard time in this case. Please see
the member description for an example.
java.lang.IllegalArgumentException
- the month, dayOfWeekInMonth,
dayOfWeek, or time parameters are out of rangepublic void setStartRule(int month, int dayOfMonth, int time)
month
- The month in which this rule occurs (0-based).dayOfMonth
- The date in that month (1-based).time
- 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.
java.lang.IllegalArgumentException
- the month,
dayOfMonth, or time parameters are out of rangepublic void setStartRule(int month, int dayOfMonth, int dayOfWeek, int time, boolean after)
month
- The month in which this rule occurs (0-based).dayOfMonth
- A date within that month (1-based).dayOfWeek
- The day of the week on which this rule occurs.time
- 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.after
- If true, this rule selects the first dayOfWeek on
or after dayOfMonth. If false, this rule selects
the last dayOfWeek on or before dayOfMonth.
java.lang.IllegalArgumentException
- the month, dayOfMonth,
dayOfWeek, or time parameters are out of rangepublic void setEndRule(int month, int dayOfWeekInMonth, int dayOfWeek, int time)
month
- The daylight savings ending month. Month is
0-based. eg, 0 for January.dayOfWeekInMonth
- The daylight savings ending
day-of-week-in-month. Please see the member
description for an example.dayOfWeek
- The daylight savings ending day-of-week. Please
see the member description for an example.time
- The daylight savings ending time in local wall time,
which is daylight time in this case. Please see the
member description for an example.
java.lang.IllegalArgumentException
- the month, dayOfWeekInMonth,
dayOfWeek, or time parameters are out of rangepublic void setEndRule(int month, int dayOfMonth, int time)
month
- The month in which this rule occurs (0-based).dayOfMonth
- The date in that month (1-based).time
- The time of that day (number of millis after midnight)
when DST ends in local wall time, which is daylight
time in this case.
java.lang.IllegalArgumentException
- the month,
dayOfMonth, or time parameters are out of rangepublic void setEndRule(int month, int dayOfMonth, int dayOfWeek, int time, boolean after)
month
- The month in which this rule occurs (0-based).dayOfMonth
- A date within that month (1-based).dayOfWeek
- The day of the week on which this rule occurs.time
- The time of that day (number of millis after midnight)
when DST ends in local wall time, which is daylight
time in this case.after
- If true, this rule selects the first dayOfWeek on
or after dayOfMonth. If false, this rule selects
the last dayOfWeek on or before dayOfMonth.
java.lang.IllegalArgumentException
- the month, dayOfMonth,
dayOfWeek, or time parameters are out of rangepublic void setDSTSavings(int millisSavedDuringDST)
millisSavedDuringDST
- the number of milliseconds the time is
advanced with respect to standard time when the daylight savings rules
are in effect. A positive number, typically one hour (3600000).public int getDSTSavings()
public java.lang.String toString()
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis)
com.ibm.icu.impl.JDKTimeZone
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis, int monthLength)
public boolean useDaylightTime()
com.ibm.icu.impl.JDKTimeZone
public boolean inDaylightTime(java.util.Date date)
com.ibm.icu.impl.JDKTimeZone
public boolean equals(java.lang.Object obj)
public int hashCode()
public java.lang.Object clone()
public boolean hasSameRules(TimeZone othr)
com.ibm.icu.impl.JDKTimeZone
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |