SimpleTimeZone (Java SE 26 & JDK 26)
- All Implemented Interfaces:
Serializable, Cloneable
-
Field Summary
Fields
static final intConstant for a mode of start or end time specified as standard time.
static final intConstant for a mode of start or end time specified as UTC.
static final intConstant for a mode of start or end time specified as wall clock time.
-
Constructor Summary
Constructors
Constructs a SimpleTimeZone with the given base time zone offset from GMT and time zone ID with no daylight saving time schedule.
SimpleTimeZone(int rawOffset, String ID, int startMonth, int startDay, int startDayOfWeek, int startTime, int endMonth, int endDay, int endDayOfWeek, int endTime) Constructs a SimpleTimeZone with the given base time zone offset from GMT, time zone ID, and rules for starting and ending the daylight time.
SimpleTimeZone(int rawOffset, String ID, int startMonth, int startDay, int startDayOfWeek, int startTime, int endMonth, int endDay, int endDayOfWeek, int endTime, int dstSavings) Constructs a SimpleTimeZone with the given base time zone offset from GMT, time zone ID, and rules for starting and ending the daylight time.
SimpleTimeZone(int rawOffset, String ID, int startMonth, int startDay, int startDayOfWeek, int startTime, int startTimeMode, int endMonth, int endDay, int endDayOfWeek, int endTime, int endTimeMode, int dstSavings) Constructs a SimpleTimeZone with the given base time zone offset from GMT, time zone ID, and rules for starting and ending the daylight time.
-
Method Summary
clone()Returns a clone of this
SimpleTimeZoneinstance.booleanCompares the equality of two
SimpleTimeZoneobjects.intReturns the amount of time in milliseconds that the clock is advanced during daylight saving time.
intgetOffset(int era, int year, int month, int day, int dayOfWeek, int millis) Returns the difference in milliseconds between local time and UTC, taking into account both the raw offset and the effect of daylight saving, for the specified date and time.
intgetOffset(long date) Returns the offset of this time zone from UTC at the given time.
intGets the GMT offset for this time zone.
inthashCode()Generates the hash code for the SimpleTimeZone object.
booleanReturns
trueif this zone has the same rules and offset as another zone.booleanQueries if the given date is in daylight saving time.
booleanReturns
trueif thisSimpleTimeZoneobserves Daylight Saving Time.voidsetDSTSavings(int millisSavedDuringDST) Sets the amount of time in milliseconds that the clock is advanced during daylight saving time.
voidsetEndRule(int endMonth, int endDay, int endTime) Sets the daylight saving time end rule to a fixed date within a month.
voidsetEndRule(int endMonth, int endDay, int endDayOfWeek, int endTime) Sets the daylight saving time end rule.
voidsetEndRule(int endMonth, int endDay, int endDayOfWeek, int endTime, boolean after) Sets the daylight saving time end rule to a weekday before or after the given date within a month, e.g., the first Monday on or after the 8th.
voidsetRawOffset(int offsetMillis) Sets the base time zone offset to GMT.
voidsetStartRule(int startMonth, int startDay, int startTime) Sets the daylight saving time start rule to a fixed date within a month.
voidsetStartRule(int startMonth, int startDay, int startDayOfWeek, int startTime) Sets the daylight saving time start rule.
voidsetStartRule(int startMonth, int startDay, int startDayOfWeek, int startTime, boolean after) Sets the daylight saving time start rule to a weekday before or after the given date within a month, e.g., the first Monday on or after the 8th.
voidsetStartYear(int year) Sets the daylight saving time starting year.
toString()Returns a string representation of this time zone.
booleanQueries if this time zone uses daylight saving time.
Methods declared in class TimeZone
availableIDs, availableIDs, getAvailableIDs, getAvailableIDs, getDefault, getDisplayName, getDisplayName, getDisplayName, getDisplayName, getID, getTimeZone, getTimeZone, setDefault, setID, toZoneIdReturns a stream of the available IDs supported.
Gets the available IDs according to the given time zone offset in milliseconds.
Returns an array of the available IDs supported.
Gets the available IDs according to the given time zone offset in milliseconds.
Gets the default
TimeZoneof the Java virtual machine.Returns a long standard time name of this
TimeZonesuitable for presentation to the user in the default locale.Returns a name in the specified
styleof thisTimeZonesuitable for presentation to the user in the default locale.Returns a name in the specified
styleof thisTimeZonesuitable for presentation to the user in the specifiedlocale.Returns a long standard time name of this
TimeZonesuitable for presentation to the user in the specifiedlocale.Gets the ID of this time zone.
Gets the
TimeZonefor the given ID.Gets the
TimeZonefor the givenzoneId.static voidSets the
TimeZonethat is returned by thegetDefaultmethod.voidConverts this
TimeZoneobject to aZoneId.Methods declared in class Object
finalize, getClass, notify, notifyAll, wait, wait, waitprotected voidDeprecated, for removal: This API element is subject to removal in a future version.
Returns the runtime class of this
Object.final voidWakes up a single thread that is waiting on this object's monitor.
final voidWakes up all threads that are waiting on this object's monitor.
final voidCauses the current thread to wait until it is awakened, typically by being notified or interrupted.
final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Field Details
-
WALL_TIME
-
STANDARD_TIME
-
UTC_TIME
-
-
Constructor Details
-
SimpleTimeZone
-
SimpleTimeZone
-
SimpleTimeZone
-
SimpleTimeZone
-
-
Method Details
-
setStartYear
-
setStartRule
-
setStartRule
-
setStartRule
-
setEndRule
-
setEndRule
-
setEndRule
-
getOffset
-
getOffset
-
getRawOffset
-
setRawOffset
-
setDSTSavings
-
getDSTSavings
-
useDaylightTime
-
observesDaylightTime
-
inDaylightTime
-
clone
-
hashCode
-
equals
-
hasSameRules
-
toString
-