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 TimeZone
TimeZone.SystemTimeZoneType -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate intprivate static final longFields inherited from class 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.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.intGets unmodified offset, NOT modified in case of daylight savings.booleaninDaylightTime(Date date) Queries if the given date is in daylight savings time in this time zone.booleanisFrozen()Determines whether the object has been frozen or not.voidsetRawOffset(int offsetMillis) Sets the base time zone offset to GMT.booleanQueries if this time zone uses daylight savings time.Methods inherited from class 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:TimeZoneGets 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:
getOffsetin 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:TimeZoneSets the base time zone offset to GMT. This is the offset to add to UTC to get local time.- Specified by:
setRawOffsetin classTimeZone- Parameters:
offsetMillis- the given base time zone offset to GMT.
-
getRawOffset
public int getRawOffset()Description copied from class:TimeZoneGets unmodified offset, NOT modified in case of daylight savings. This is the offset to add to UTC to get local time.- Specified by:
getRawOffsetin classTimeZone- Returns:
- the unmodified offset to add to UTC to get local time.
-
useDaylightTime
public boolean useDaylightTime()Description copied from class:TimeZoneQueries if this time zone uses daylight savings time.- Specified by:
useDaylightTimein 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
falsefor such case. The default implementation of this method returnstruewhen the time zone uses daylight savings time in the current (Gregorian) calendar year.
-
inDaylightTime
Description copied from class:TimeZoneQueries if the given date is in daylight savings time in this time zone.- Specified by:
inDaylightTimein classTimeZone- Parameters:
date- the given Date.- Returns:
- true if the given date is in daylight savings time, false, otherwise.
-
isFrozen
-
freeze
-
cloneAsThawed
Description copied from class:TimeZoneProvides for the clone operation. Any clone is initially unfrozen.- Specified by:
cloneAsThawedin interfaceFreezable<TimeZone>- Overrides:
cloneAsThawedin classTimeZone
-