All Packages Class Hierarchy This Package Previous Next Index
Class java.util.SimpleTimeZone
java.lang.Object
|
+----java.util.TimeZone
|
+----java.util.SimpleTimeZone
- public class SimpleTimeZone
- extends TimeZone
SimpleTimeZone is a concrete subclass of TimeZone
that represents a time zone for use with a Gregorian
calendar. This simple class does not handle historical
changes, and has limited rules.
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.
- See Also:
- Calendar, GregorianCalendar, TimeZone
-
SimpleTimeZone(int, String)
- Constructs a SimpleTimeZone with the given base time zone offset
from GMT and time zone ID.
-
SimpleTimeZone(int, String, int, int, int, int, int, int, int, int)
- Constructs a SimpleTimeZone with the given base time zone offset
from GMT, time zone ID, time to start and end the daylight time.
-
clone()
- Overrides Cloneable
-
equals(Object)
- Compares the equality of two SimpleTimeZone objects.
-
getOffset(int, int, int, int, int, int)
- Overrides TimeZone
Gets offset, for current date, modified in case of daylight savings.
-
getRawOffset()
- Overrides TimeZone
Gets the GMT offset for this time zone.
-
hashCode()
- Override hashCode.
-
inDaylightTime(Date)
- Overrides TimeZone
Queries if the given date is in Daylight Savings Time.
-
setEndRule(int, int, int, int)
- Sets the daylight savings ending rule.
-
setRawOffset(int)
- Overrides TimeZone
Sets the base time zone offset to GMT.
-
setStartRule(int, int, int, int)
- Sets the daylight savings starting rule.
-
setStartYear(int)
- Sets the daylight savings starting year.
-
useDaylightTime()
- Overrides TimeZone
Queries if this time zone uses Daylight Savings Time.
SimpleTimeZone
method SimpleTimeZone(rawOffset=int, -
ID=String) public
- Constructs a SimpleTimeZone with the given base time zone offset
from GMT and time zone ID. Timezone IDs can be obtained from
TimeZone.getAvailableIDs. Normally you should use TimeZone.getDefault
to construct a TimeZone.
- Parameters:
- rawOffset - the given base time zone offset to GMT.
- ID - the time zone ID which is obtained from
TimeZone.getAvailableIDs.
SimpleTimeZone
method SimpleTimeZone(rawOffset=int, -
ID=String, -
startMonth=int, -
startDayOfWeekInMonth=int, -
startDayOfWeek=int, -
startTime=int, -
endMonth=int, -
endDayOfWeekInMonth=int, -
endDayOfWeek=int, -
endTime=int) public
- Constructs a SimpleTimeZone with the given base time zone offset
from GMT, time zone ID, time to start and end the daylight time.
Timezone IDs can be obtained from TimeZone.getAvailableIDs.
Normally you should use TimeZone.getDefault to create a TimeZone.
For a time zone that does not use daylight saving time, do not
use this constructor; instead you should use
SimpleTimeZone(rawOffset, ID).
- Parameters:
- 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.
- startDayOfWeekInMonth - 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. Please see the
member description for an example.
- endMonth - the daylight savings ending month. Month is 0-based.
eg, 0 for January.
- endDayOfWeekInMonth - 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. Please see the member
description for an example.
setStartYear
method setStartYear(year=int) public
- Sets the daylight savings starting year.
- Parameters:
- year - the daylight savings starting year.
setStartRule
method setStartRule(month=int, -
dayOfWeekInMonth=int, -
dayOfWeek=int, -
time=int) public
- Sets the daylight savings starting rule. For example, Daylight Savings
Time starts at the first Sunday in April, at 2 AM in standard time.
Therefore, you can set the start rule by calling:
setStartRule(TimeFields.APRIL, 1, TimeFields.SUNDAY, 2*60*60*1000);
- Parameters:
- 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. Please see the member
description for an example.
setEndRule
method setEndRule(month=int, -
dayOfWeekInMonth=int, -
dayOfWeek=int, -
time=int) public
- Sets the daylight savings ending rule. For example, Daylight Savings
Time ends at the last (-1) Sunday in October, at 2 AM in standard time.
Therefore, you can set the end rule by calling:
setEndRule(TimeFields.OCTOBER, -1, TimeFields.SUNDAY, 2*60*60*1000);
- Parameters:
- 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. Please see the member
description for an example.
getOffset
method getOffset(era=int, -
year=int, -
month=int, -
day=int, -
dayOfWeek=int, -
millis=int) returns int public
- Overrides TimeZone
Gets offset, for current date, modified in case of daylight savings.
This is the offset to add *to* UTC to get local time.
Please see TimeZone.getOffset for descriptions on parameters.
- Overrides:
- getOffset in class TimeZone
getRawOffset
method getRawOffset() returns int public
- Overrides TimeZone
Gets the GMT offset for this time zone.
- Overrides:
- getRawOffset in class TimeZone
setRawOffset
method setRawOffset(offsetMillis=int) public
- Overrides TimeZone
Sets the base time zone offset to GMT.
This is the offset to add *to* UTC to get local time.
Please see TimeZone.setRawOffset for descriptions on the parameter.
- Overrides:
- setRawOffset in class TimeZone
useDaylightTime
method useDaylightTime() returns boolean public
- Overrides TimeZone
Queries if this time zone uses Daylight Savings Time.
- Overrides:
- useDaylightTime in class TimeZone
inDaylightTime
method inDaylightTime(date=Date) returns boolean public
- Overrides TimeZone
Queries if the given date is in Daylight Savings Time.
- Overrides:
- inDaylightTime in class TimeZone
clone
method clone() returns Object public
- Overrides Cloneable
- Overrides:
- clone in class TimeZone
hashCode
method hashCode() returns int public protect
- Override hashCode.
Generates the hash code for the SimpleDateFormat object
- Overrides:
- hashCode in class Object
equals
method equals(obj=Object) returns boolean public
- Compares the equality of two SimpleTimeZone objects.
- Parameters:
- obj - the SimpleTimeZone object to be compared with.
- Returns:
- true if the given obj is the same as this SimpleTimeZone
object; false otherwise.
- Overrides:
- equals in class Object
All Packages Class Hierarchy This Package Previous Next Index