Class TimeZone.ConstantZone

  • All Implemented Interfaces:
    Freezable<TimeZone>, java.io.Serializable, java.lang.Cloneable
    Enclosing class:
    TimeZone

    private static final class TimeZone.ConstantZone
    extends TimeZone
    • Field Detail

      • rawOffset

        private int rawOffset
      • isFrozen

        private transient volatile boolean isFrozen
    • Constructor Detail

      • ConstantZone

        private ConstantZone​(int rawOffset,
                             java.lang.String ID)
    • Method Detail

      • getOffset

        public int getOffset​(int era,
                             int year,
                             int month,
                             int day,
                             int dayOfWeek,
                             int milliseconds)
        Description copied from class: TimeZone
        Gets the time zone offset, for current date, modified in case of daylight savings. This is the offset to add to UTC to get local time.
        Specified by:
        getOffset in class TimeZone
        Parameters:
        era - the era of the given date.
        year - the year in the given date.
        month - the month in the given date. Month is 0-based. e.g., 0 for January.
        day - the day-in-month of the given date.
        dayOfWeek - the day-of-week of the given date.
        milliseconds - the millis in day in standard local time.
        Returns:
        the offset to add to GMT to get local time.
      • setRawOffset

        public void setRawOffset​(int offsetMillis)
        Description copied from class: TimeZone
        Sets the base time zone offset to GMT. This is the offset to add to UTC to get local time.
        Specified by:
        setRawOffset in class TimeZone
        Parameters:
        offsetMillis - the given base time zone offset to GMT.
      • getRawOffset

        public int getRawOffset()
        Description copied from class: TimeZone
        Gets unmodified offset, NOT modified in case of daylight savings. This is the offset to add to UTC to get local time.
        Specified by:
        getRawOffset in class TimeZone
        Returns:
        the unmodified offset to add to UTC to get local time.
      • useDaylightTime

        public boolean useDaylightTime()
        Description copied from class: TimeZone
        Queries if this time zone uses daylight savings time.
        Specified by:
        useDaylightTime in class TimeZone
        Returns:
        true if this time zone uses daylight savings time, false, otherwise.

        Note:The default implementation of ICU TimeZone uses the tz database, which supports historic rule changes, for system time zones. With the implementation, there are time zones that used daylight savings time in the past, but no longer used currently. For example, Asia/Tokyo has never used daylight savings time since 1951. Most clients would expect that this method to return false for such case. The default implementation of this method returns true when the time zone uses daylight savings time in the current (Gregorian) calendar year.

      • inDaylightTime

        public boolean inDaylightTime​(java.util.Date date)
        Description copied from class: TimeZone
        Queries if the given date is in daylight savings time in this time zone.
        Specified by:
        inDaylightTime in class TimeZone
        Parameters:
        date - the given Date.
        Returns:
        true if the given date is in daylight savings time, false, otherwise.