TimeZone (Java SE 26 & JDK 26)
- All Implemented Interfaces:
Serializable, Cloneable
- Direct Known Subclasses:
SimpleTimeZone
-
Field Summary
Fields
static final intA style specifier for
getDisplayName()indicating a long name, such as "Pacific Standard Time."static final intA style specifier for
getDisplayName()indicating a short name, such as "PST." -
Constructor Summary
Constructors
-
Method Summary
Returns a stream of the available IDs supported.
availableIDs(int rawOffset) Gets the available IDs according to the given time zone offset in milliseconds.
clone()Creates a copy of this
TimeZone.Returns an array of the available IDs supported.
getAvailableIDs(int rawOffset) 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.getDisplayName(boolean daylight, int style) Returns a name in the specified
styleof thisTimeZonesuitable for presentation to the user in the default locale.getDisplayName(boolean daylight, int style, Locale 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.intReturns the amount of time to be added to local standard time to get local wall clock time.
getID()Gets the ID of this time zone.
abstract intgetOffset(int era, int year, int month, int day, int dayOfWeek, int milliseconds) Gets the time zone offset, for current date, modified in case of daylight savings.
intgetOffset(long date) Returns the offset of this time zone from UTC at the specified date.
abstract intReturns the amount of time in milliseconds to add to UTC to get standard time in this time zone.
Gets the
TimeZonefor the given ID.Gets the
TimeZonefor the givenzoneId.booleanReturns true if this zone has the same rule and offset as another zone.
abstract booleanQueries if the given
dateis in Daylight Saving Time in this time zone.booleanReturns
trueif thisTimeZoneis currently in Daylight Saving Time, or if a transition from Standard Time to Daylight Saving Time occurs at any future time.static voidSets the
TimeZonethat is returned by thegetDefaultmethod.voidabstract voidsetRawOffset(int offsetMillis) Sets the base time zone offset to GMT.
toZoneId()Converts this
TimeZoneobject to aZoneId.abstract booleanQueries if this
TimeZoneuses Daylight Saving Time.Methods declared in class Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbooleanIndicates whether some other object is "equal to" this one.
protected voidDeprecated, for removal: This API element is subject to removal in a future version.
Returns the runtime class of this
Object.intReturns a hash code value for 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.
Returns a string representation of the object.
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
-
SHORT
-
LONG
-
-
Constructor Details
-
TimeZone
-
-
Method Details
-
getOffset
-
getOffset
-
setRawOffset
-
getRawOffset
-
getID
-
setID
-
getDisplayName
-
getDisplayName
-
getDisplayName
-
getDisplayName
-
getDSTSavings
-
useDaylightTime
-
observesDaylightTime
-
inDaylightTime
-
getTimeZone
-
getTimeZone
-
toZoneId
-
getAvailableIDs
-
getAvailableIDs
-
availableIDs
-
availableIDs
-
getDefault
-
setDefault
-
hasSameRules
-
clone
-