| java.lang.Object java.util.TimeZone java.util.SimpleTimeZone
SimpleTimeZone | public class SimpleTimeZone extends TimeZone (Code) | | SimpleTimeZone represents a local time zone and its daylight savings time
rules for the gregorian calendar.
See Also: Calendar See Also: TimeZone |
Constructor Summary | |
public | SimpleTimeZone(int offset, String name) Constructs a new SimpleTimeZone using the specified offset for standard
time from GMT and the specified time zone ID. | public | SimpleTimeZone(int offset, String name, int startMonth, int startDay, int startDayOfWeek, int startTime, int endMonth, int endDay, int endDayOfWeek, int endTime) Constructs a new SimpleTimeZone using the specified offset for standard
time from GMT, the specified time zone ID and the rules for daylight
savings time. | public | SimpleTimeZone(int offset, String name, int startMonth, int startDay, int startDayOfWeek, int startTime, int endMonth, int endDay, int endDayOfWeek, int endTime, int daylightSavings) Constructs a new SimpleTimeZone using the specified offset for standard
time from GMT, the specified time zone ID and the rules for daylight
savings time. | public | SimpleTimeZone(int offset, String name, int startMonth, int startDay, int startDayOfWeek, int startTime, int startTimeMode, int endMonth, int endDay, int endDayOfWeek, int endTime, int endTimeMode, int daylightSavings) Constructs a new SimpleTimeZone using the specified offset for standard
time from GMT, the specified time zone ID, the rules for daylight savings
time, and the modes indicating UTC, standard, or wall time. |
Method Summary | |
public Object | clone() Answers a new SimpleTimeZone with the same ID, rawOffset and daylight
savings time rules as this SimpleTimeZone. | public boolean | equals(Object object) Compares the specified object to this SimpleTimeZone and answer if they
are equal. | public int | getDSTSavings() Gets the daylight savings offset in milliseconds for this SimpleTimeZone. | public int | getOffset(int era, int year, int month, int day, int dayOfWeek, int time) Gets the offset from GMT of this SimpleTimeZone for the specified date
and time. | public int | getOffset(long time) Gets the offset from GMT of this SimpleTimeZone for the specified date. | public int | getRawOffset() Gets the offset for standard time from GMT for this SimpleTimeZone. | public boolean | hasSameRules(TimeZone zone) Answers if the specified TimeZone has the same raw offset and daylight
savings time rules as this SimpleTimeZone. | public synchronized int | hashCode() Answers an integer hash code for the receiver. | public boolean | inDaylightTime(Date time) Answers if the specified Date is in the daylight savings time period for
this SimpleTimeZone. | public void | setDSTSavings(int milliseconds) Sets the daylight savings offset in milliseconds for this SimpleTimeZone. | public void | setEndRule(int month, int dayOfMonth, int time) Sets the rule which specifies the end of daylight savings time. | public void | setEndRule(int month, int day, int dayOfWeek, int time) Sets the rule which specifies the end of daylight savings time. | public void | setEndRule(int month, int day, int dayOfWeek, int time, boolean after) Sets the rule which specifies the end of daylight savings time. | public void | setRawOffset(int offset) Sets the offset for standard time from GMT for this SimpleTimeZone. | public void | setStartRule(int month, int dayOfMonth, int time) Sets the rule which specifies the start of daylight savings time. | public void | setStartRule(int month, int day, int dayOfWeek, int time) Sets the rule which specifies the start of daylight savings time. | public void | setStartRule(int month, int day, int dayOfWeek, int time, boolean after) Sets the rule which specifies the start of daylight savings time. | public void | setStartYear(int year) Sets the starting year for daylight savings time in this SimpleTimeZone. | public String | toString() Answers the string representation of this SimpleTimeZone. | public boolean | useDaylightTime() Answers if this TimeZone has a daylight savings time period. |
STANDARD_TIME | final public static int STANDARD_TIME(Code) | | |
UTC_TIME | final public static int UTC_TIME(Code) | | |
WALL_TIME | final public static int WALL_TIME(Code) | | |
SimpleTimeZone | public SimpleTimeZone(int offset, String name)(Code) | | Constructs a new SimpleTimeZone using the specified offset for standard
time from GMT and the specified time zone ID.
Parameters: offset - the offset from GMT of standard time in milliseconds Parameters: name - the time zone ID |
SimpleTimeZone | public SimpleTimeZone(int offset, String name, int startMonth, int startDay, int startDayOfWeek, int startTime, int endMonth, int endDay, int endDayOfWeek, int endTime)(Code) | | Constructs a new SimpleTimeZone using the specified offset for standard
time from GMT, the specified time zone ID and the rules for daylight
savings time.
Parameters: offset - the offset from GMT of standard time in milliseconds Parameters: name - the time zone ID Parameters: startMonth - the Calendar month in which daylight savings time starts Parameters: startDay - the occurrence of the day of the week on which daylightsavings time starts Parameters: startDayOfWeek - the Calendar day of the week on which daylight savings timestarts Parameters: startTime - the time of day in milliseconds on which daylight savings timestarts Parameters: endMonth - the Calendar month in which daylight savings time ends Parameters: endDay - the occurrence of the day of the week on which daylightsavings time ends Parameters: endDayOfWeek - the Calendar day of the week on which daylight savings timeends Parameters: endTime - the time of day in milliseconds standard time on whichdaylight savings time ends |
SimpleTimeZone | public SimpleTimeZone(int offset, String name, int startMonth, int startDay, int startDayOfWeek, int startTime, int endMonth, int endDay, int endDayOfWeek, int endTime, int daylightSavings)(Code) | | Constructs a new SimpleTimeZone using the specified offset for standard
time from GMT, the specified time zone ID and the rules for daylight
savings time.
Parameters: offset - the offset from GMT of standard time in milliseconds Parameters: name - the time zone ID Parameters: startMonth - the Calendar month in which daylight savings time starts Parameters: startDay - the occurrence of the day of the week on which daylightsavings time starts Parameters: startDayOfWeek - the Calendar day of the week on which daylight savings timestarts Parameters: startTime - the time of day in milliseconds on which daylight savings timestarts Parameters: endMonth - the Calendar month in which daylight savings time ends Parameters: endDay - the occurrence of the day of the week on which daylightsavings time ends Parameters: endDayOfWeek - the Calendar day of the week on which daylight savings timeends Parameters: endTime - the time of day in milliseconds standard time on whichdaylight savings time ends Parameters: daylightSavings - the daylight savings time difference in milliseconds |
SimpleTimeZone | public SimpleTimeZone(int offset, String name, int startMonth, int startDay, int startDayOfWeek, int startTime, int startTimeMode, int endMonth, int endDay, int endDayOfWeek, int endTime, int endTimeMode, int daylightSavings)(Code) | | Constructs a new SimpleTimeZone using the specified offset for standard
time from GMT, the specified time zone ID, the rules for daylight savings
time, and the modes indicating UTC, standard, or wall time.
Parameters: offset - the offset from GMT of standard time in milliseconds Parameters: name - the time zone ID Parameters: startMonth - the Calendar month in which daylight savings time starts Parameters: startDay - the occurrence of the day of the week on which daylightsavings time starts Parameters: startDayOfWeek - the Calendar day of the week on which daylight savings timestarts Parameters: startTime - the time of day in milliseconds on which daylight savings timestarts Parameters: startTimeMode - the mode (UTC, standard, or wall time) of the start time value Parameters: endMonth - the Calendar month in which daylight savings time ends Parameters: endDay - the occurrence of the day of the week on which daylightsavings time ends Parameters: endDayOfWeek - the Calendar day of the week on which daylight savings timeends Parameters: endTime - the time of day in milliseconds standard time on whichdaylight savings time ends Parameters: endTimeMode - the mode (UTC, standard, or wall time) of the end time value Parameters: daylightSavings - the daylight savings time difference in milliseconds |
clone | public Object clone()(Code) | | Answers a new SimpleTimeZone with the same ID, rawOffset and daylight
savings time rules as this SimpleTimeZone.
a shallow copy of this SimpleTimeZone See Also: java.lang.Cloneable |
equals | public boolean equals(Object object)(Code) | | Compares the specified object to this SimpleTimeZone and answer if they
are equal. The object must be an instance of SimpleTimeZone and have the
same properties.
Parameters: object - the object to compare with this object true if the specified object is equal to this SimpleTimeZone,false otherwise See Also: SimpleTimeZone.hashCode |
getDSTSavings | public int getDSTSavings()(Code) | | Gets the daylight savings offset in milliseconds for this SimpleTimeZone.
If this SimpleTimezone does not observe daylight savings, returns 0.
the daylight savings offset in milliseconds |
getOffset | public int getOffset(int era, int year, int month, int day, int dayOfWeek, int time)(Code) | | Gets the offset from GMT of this SimpleTimeZone for the specified date
and time. The offset includes daylight savings time if the specified date
and time are within the daylight savings time period.
Parameters: era - the GregorianCalendar era, either GregorianCalendar.BC orGregorianCalendar.AD Parameters: year - the year Parameters: month - the Calendar month Parameters: day - the day of the month Parameters: dayOfWeek - the Calendar day of the week Parameters: time - the time of day in milliseconds the offset from GMT in milliseconds |
getOffset | public int getOffset(long time)(Code) | | Gets the offset from GMT of this SimpleTimeZone for the specified date.
The offset includes daylight savings time if the specified date is within
the daylight savings time period.
Parameters: time - the date in milliseconds since January 1, 1970 00:00:00 GMT the offset from GMT in milliseconds |
getRawOffset | public int getRawOffset()(Code) | | Gets the offset for standard time from GMT for this SimpleTimeZone.
the offset from GMT of standard time in milliseconds |
hasSameRules | public boolean hasSameRules(TimeZone zone)(Code) | | Answers if the specified TimeZone has the same raw offset and daylight
savings time rules as this SimpleTimeZone.
Parameters: zone - a TimeZone true when the TimeZones have the same raw offset and daylightsavings time rules, false otherwise |
hashCode | public synchronized int hashCode()(Code) | | Answers an integer hash code for the receiver. Objects which are equal
answer the same value for this method.
the receiver's hash See Also: SimpleTimeZone.equals |
inDaylightTime | public boolean inDaylightTime(Date time)(Code) | | Answers if the specified Date is in the daylight savings time period for
this SimpleTimeZone.
Parameters: time - a Date true when the Date is in the daylight savings time period, falseotherwise |
setDSTSavings | public void setDSTSavings(int milliseconds)(Code) | | Sets the daylight savings offset in milliseconds for this SimpleTimeZone.
Parameters: milliseconds - the daylight savings offset in milliseconds |
setEndRule | public void setEndRule(int month, int dayOfMonth, int time)(Code) | | Sets the rule which specifies the end of daylight savings time.
Parameters: month - the Calendar month in which daylight savings time ends Parameters: dayOfMonth - the Calendar day of the month on which daylight savings timeends Parameters: time - the time of day in milliseconds standard time on whichdaylight savings time ends |
setEndRule | public void setEndRule(int month, int day, int dayOfWeek, int time)(Code) | | Sets the rule which specifies the end of daylight savings time.
Parameters: month - the Calendar month in which daylight savings time ends Parameters: day - the occurrence of the day of the week on which daylightsavings time ends Parameters: dayOfWeek - the Calendar day of the week on which daylight savings timeends Parameters: time - the time of day in milliseconds standard time on whichdaylight savings time ends |
setEndRule | public void setEndRule(int month, int day, int dayOfWeek, int time, boolean after)(Code) | | Sets the rule which specifies the end of daylight savings time.
Parameters: month - the Calendar month in which daylight savings time ends Parameters: day - the Calendar day of the month Parameters: dayOfWeek - the Calendar day of the week on which daylight savings timeends Parameters: time - the time of day in milliseconds on which daylight savings timeends Parameters: after - selects the day after or before the day of month |
setRawOffset | public void setRawOffset(int offset)(Code) | | Sets the offset for standard time from GMT for this SimpleTimeZone.
Parameters: offset - the offset from GMT of standard time in milliseconds |
setStartRule | public void setStartRule(int month, int dayOfMonth, int time)(Code) | | Sets the rule which specifies the start of daylight savings time.
Parameters: month - the Calendar month in which daylight savings time starts Parameters: dayOfMonth - the Calendar day of the month on which daylight savings timestarts Parameters: time - the time of day in milliseconds on which daylight savings timestarts |
setStartRule | public void setStartRule(int month, int day, int dayOfWeek, int time)(Code) | | Sets the rule which specifies the start of daylight savings time.
Parameters: month - the Calendar month in which daylight savings time starts Parameters: day - the occurrence of the day of the week on which daylightsavings time starts Parameters: dayOfWeek - the Calendar day of the week on which daylight savings timestarts Parameters: time - the time of day in milliseconds on which daylight savings timestarts |
setStartRule | public void setStartRule(int month, int day, int dayOfWeek, int time, boolean after)(Code) | | Sets the rule which specifies the start of daylight savings time.
Parameters: month - the Calendar month in which daylight savings time starts Parameters: day - the Calendar day of the month Parameters: dayOfWeek - the Calendar day of the week on which daylight savings timestarts Parameters: time - the time of day in milliseconds on which daylight savings timestarts Parameters: after - selects the day after or before the day of month |
setStartYear | public void setStartYear(int year)(Code) | | Sets the starting year for daylight savings time in this SimpleTimeZone.
Years before this start year will always be in standard time.
Parameters: year - the starting year |
toString | public String toString()(Code) | | Answers the string representation of this SimpleTimeZone.
the string representation of this SimpleTimeZone |
useDaylightTime | public boolean useDaylightTime()(Code) | | Answers if this TimeZone has a daylight savings time period.
true if this time zone has a daylight savings time period, falseotherwise |
|
|