Package com.ibm.icu.util
Class TimeZone.ConstantZone
java.lang.Object
com.ibm.icu.util.TimeZone
com.ibm.icu.util.TimeZone.ConstantZone
- All Implemented Interfaces:
Freezable<TimeZone>
,Serializable
,Cloneable
- Enclosing class:
- TimeZone
-
Nested Class Summary
Nested classes/interfaces inherited from class com.ibm.icu.util.TimeZone
TimeZone.SystemTimeZoneType
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private int
private static final long
Fields inherited from class com.ibm.icu.util.TimeZone
GENERIC_LOCATION, GMT_ZONE, GMT_ZONE_ID, LONG, LONG_GENERIC, LONG_GMT, SHORT, SHORT_COMMONLY_USED, SHORT_GENERIC, SHORT_GMT, TIMEZONE_ICU, TIMEZONE_JDK, UNKNOWN_ZONE, UNKNOWN_ZONE_ID
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionProvides for the clone operation.freeze()
Freezes the object.int
getOffset
(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.int
Gets unmodified offset, NOT modified in case of daylight savings.boolean
inDaylightTime
(Date date) Queries if the given date is in daylight savings time in this time zone.boolean
isFrozen()
Determines whether the object has been frozen or not.void
setRawOffset
(int offsetMillis) Sets the base time zone offset to GMT.boolean
Queries if this time zone uses daylight savings time.Methods inherited from class com.ibm.icu.util.TimeZone
clone, countEquivalentIDs, equals, forLocaleOrDefault, forULocaleOrDefault, getAvailableIDs, getAvailableIDs, getAvailableIDs, getAvailableIDs, getCanonicalID, getCanonicalID, getDefault, getDefaultTimeZoneType, getDisplayName, getDisplayName, getDisplayName, getDisplayName, getDisplayName, getDisplayName, getDSTSavings, getEquivalentID, getFrozenICUTimeZone, getFrozenTimeZone, getIanaID, getID, getIDForWindowsID, getOffset, getOffset, getRegion, getTimeZone, getTimeZone, getTZDataVersion, getWindowsID, hashCode, hasSameRules, observesDaylightTime, setDefault, setDefaultTimeZoneType, setICUDefault, setID
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
rawOffset
private int rawOffset -
isFrozen
private transient volatile boolean isFrozen
-
-
Constructor Details
-
ConstantZone
-
-
Method Details
-
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 classTimeZone
- 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 classTimeZone
- 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 classTimeZone
- 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 classTimeZone
- 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 returnstrue
when the time zone uses daylight savings time in the current (Gregorian) calendar year.
-
inDaylightTime
Description copied from class:TimeZone
Queries if the given date is in daylight savings time in this time zone.- Specified by:
inDaylightTime
in classTimeZone
- Parameters:
date
- the given Date.- Returns:
- true if the given date is in daylight savings time, false, otherwise.
-
isFrozen
public boolean isFrozen()Description copied from class:TimeZone
Determines whether the object has been frozen or not. -
freeze
Description copied from class:TimeZone
Freezes the object. -
cloneAsThawed
Description copied from class:TimeZone
Provides for the clone operation. Any clone is initially unfrozen.- Specified by:
cloneAsThawed
in interfaceFreezable<TimeZone>
- Overrides:
cloneAsThawed
in classTimeZone
-