All Implemented Interfaces:
Serializable, Cloneable

  • Field Summary

    Fields

    static final int

    Constant for a mode of start or end time specified as standard time.

    static final int

    Constant for a mode of start or end time specified as UTC.

    static final int

    Constant for a mode of start or end time specified as wall clock time.

    Fields declared in class TimeZone

    LONG, SHORT

    static final int

    A style specifier for getDisplayName() indicating a long name, such as "Pacific Standard Time."

    static final int

    A style specifier for getDisplayName() indicating a short name, such as "PST."

  • 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 SimpleTimeZone instance.

    boolean

    Compares the equality of two SimpleTimeZone objects.

    int

    Returns the amount of time in milliseconds that the clock is advanced during daylight saving time.

    int

    getOffset(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.

    int

    getOffset(long date)

    Returns the offset of this time zone from UTC at the given time.

    int

    Gets the GMT offset for this time zone.

    int

    hashCode()

    Generates the hash code for the SimpleTimeZone object.

    boolean

    Returns true if this zone has the same rules and offset as another zone.

    boolean

    Queries if the given date is in daylight saving time.

    boolean

    Returns true if this SimpleTimeZone observes Daylight Saving Time.

    void

    setDSTSavings(int millisSavedDuringDST)

    Sets the amount of time in milliseconds that the clock is advanced during daylight saving time.

    void

    setEndRule(int endMonth, int endDay, int endTime)

    Sets the daylight saving time end rule to a fixed date within a month.

    void

    setEndRule(int endMonth, int endDay, int endDayOfWeek, int endTime)

    Sets the daylight saving time end rule.

    void

    setEndRule(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.

    void

    setRawOffset(int offsetMillis)

    Sets the base time zone offset to GMT.

    void

    setStartRule(int startMonth, int startDay, int startTime)

    Sets the daylight saving time start rule to a fixed date within a month.

    void

    setStartRule(int startMonth, int startDay, int startDayOfWeek, int startTime)

    Sets the daylight saving time start rule.

    void

    setStartRule(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.

    void

    setStartYear(int year)

    Sets the daylight saving time starting year.

    toString()

    Returns a string representation of this time zone.

    boolean

    Queries 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, toZoneId

    Returns 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 TimeZone of the Java virtual machine.

    Returns a long standard time name of this TimeZone suitable for presentation to the user in the default locale.

    Returns a name in the specified style of this TimeZone suitable for presentation to the user in the default locale.

    Returns a name in the specified style of this TimeZone suitable for presentation to the user in the specified locale.

    Returns a long standard time name of this TimeZone suitable for presentation to the user in the specified locale.

    Gets the ID of this time zone.

    Gets the TimeZone for the given ID.

    Gets the TimeZone for the given zoneId.

    static void

    Sets the TimeZone that is returned by the getDefault method.

    void

    Converts this TimeZone object to a ZoneId.

    Methods declared in class Object

    finalize, getClass, notify, notifyAll, wait, wait, wait

    protected void

    Deprecated, for removal: This API element is subject to removal in a future version.

    Returns the runtime class of this Object.

    final void

    Wakes up a single thread that is waiting on this object's monitor.

    final void

    Wakes up all threads that are waiting on this object's monitor.

    final void

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

    final void

    wait(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 void

    wait(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