ICU 52.1  52.1
Public Types | Public Member Functions | Static Public Member Functions
icu::SimpleTimeZone Class Reference

SimpleTimeZone is a concrete subclass of TimeZone that represents a time zone for use with a Gregorian calendar. More...

#include <simpletz.h>

Inheritance diagram for icu::SimpleTimeZone:
icu::BasicTimeZone icu::TimeZone icu::UObject icu::UMemory

Public Types

enum  TimeMode { WALL_TIME = 0, STANDARD_TIME, UTC_TIME }
 TimeMode is used, together with a millisecond offset after midnight, to specify a rule transition time. More...
 
- Public Types inherited from icu::BasicTimeZone
enum  { kStandard = 0x01, kDaylight = 0x03, kFormer = 0x04, kLatter = 0x0C }
 The time type option bit flags used by getOffsetFromLocal. More...
 
- Public Types inherited from icu::TimeZone
enum  EDisplayType {
  SHORT = 1, LONG, SHORT_GENERIC, LONG_GENERIC,
  SHORT_GMT, LONG_GMT, SHORT_COMMONLY_USED, GENERIC_LOCATION
}
 Enum for use with getDisplayName. More...
 

Public Member Functions

 SimpleTimeZone (const SimpleTimeZone &source)
 Copy constructor. More...
 
SimpleTimeZoneoperator= (const SimpleTimeZone &right)
 Default assignment operator. More...
 
virtual ~SimpleTimeZone ()
 Destructor. More...
 
virtual UBool operator== (const TimeZone &that) const
 Returns true if the two TimeZone objects are equal; that is, they have the same ID, raw GMT offset, and DST rules. More...
 
 SimpleTimeZone (int32_t rawOffsetGMT, const UnicodeString &ID)
 Constructs a SimpleTimeZone with the given raw GMT offset and time zone ID, and which doesn't observe daylight savings time. More...
 
 SimpleTimeZone (int32_t rawOffsetGMT, const UnicodeString &ID, int8_t savingsStartMonth, int8_t savingsStartDayOfWeekInMonth, int8_t savingsStartDayOfWeek, int32_t savingsStartTime, int8_t savingsEndMonth, int8_t savingsEndDayOfWeekInMonth, int8_t savingsEndDayOfWeek, int32_t savingsEndTime, UErrorCode &status)
 Construct a SimpleTimeZone with the given raw GMT offset, time zone ID, and times to start and end daylight savings time. More...
 
 SimpleTimeZone (int32_t rawOffsetGMT, const UnicodeString &ID, int8_t savingsStartMonth, int8_t savingsStartDayOfWeekInMonth, int8_t savingsStartDayOfWeek, int32_t savingsStartTime, int8_t savingsEndMonth, int8_t savingsEndDayOfWeekInMonth, int8_t savingsEndDayOfWeek, int32_t savingsEndTime, int32_t savingsDST, UErrorCode &status)
 Construct a SimpleTimeZone with the given raw GMT offset, time zone ID, and times to start and end daylight savings time. More...
 
 SimpleTimeZone (int32_t rawOffsetGMT, const UnicodeString &ID, int8_t savingsStartMonth, int8_t savingsStartDayOfWeekInMonth, int8_t savingsStartDayOfWeek, int32_t savingsStartTime, TimeMode savingsStartTimeMode, int8_t savingsEndMonth, int8_t savingsEndDayOfWeekInMonth, int8_t savingsEndDayOfWeek, int32_t savingsEndTime, TimeMode savingsEndTimeMode, int32_t savingsDST, UErrorCode &status)
 Construct a SimpleTimeZone with the given raw GMT offset, time zone ID, and times to start and end daylight savings time. More...
 
void setStartYear (int32_t year)
 Sets the daylight savings starting year, that is, the year this time zone began observing its specified daylight savings time rules. More...
 
void setStartRule (int32_t month, int32_t dayOfWeekInMonth, int32_t dayOfWeek, int32_t time, UErrorCode &status)
 Sets the daylight savings starting rule. More...
 
void setStartRule (int32_t month, int32_t dayOfWeekInMonth, int32_t dayOfWeek, int32_t time, TimeMode mode, UErrorCode &status)
 Sets the daylight savings starting rule. More...
 
void setStartRule (int32_t month, int32_t dayOfMonth, int32_t time, UErrorCode &status)
 Sets the DST start rule to a fixed date within a month. More...
 
void setStartRule (int32_t month, int32_t dayOfMonth, int32_t time, TimeMode mode, UErrorCode &status)
 Sets the DST start rule to a fixed date within a month. More...
 
void setStartRule (int32_t month, int32_t dayOfMonth, int32_t dayOfWeek, int32_t time, UBool after, UErrorCode &status)
 Sets the DST start rule to a weekday before or after a give date within a month, e.g., the first Monday on or after the 8th. More...
 
void setStartRule (int32_t month, int32_t dayOfMonth, int32_t dayOfWeek, int32_t time, TimeMode mode, UBool after, UErrorCode &status)
 Sets the DST start rule to a weekday before or after a give date within a month, e.g., the first Monday on or after the 8th. More...
 
void setEndRule (int32_t month, int32_t dayOfWeekInMonth, int32_t dayOfWeek, int32_t time, UErrorCode &status)
 Sets the daylight savings ending rule. More...
 
void setEndRule (int32_t month, int32_t dayOfWeekInMonth, int32_t dayOfWeek, int32_t time, TimeMode mode, UErrorCode &status)
 Sets the daylight savings ending rule. More...
 
void setEndRule (int32_t month, int32_t dayOfMonth, int32_t time, UErrorCode &status)
 Sets the DST end rule to a fixed date within a month. More...
 
void setEndRule (int32_t month, int32_t dayOfMonth, int32_t time, TimeMode mode, UErrorCode &status)
 Sets the DST end rule to a fixed date within a month. More...
 
void setEndRule (int32_t month, int32_t dayOfMonth, int32_t dayOfWeek, int32_t time, UBool after, UErrorCode &status)
 Sets the DST end rule to a weekday before or after a give date within a month, e.g., the first Monday on or after the 8th. More...
 
void setEndRule (int32_t month, int32_t dayOfMonth, int32_t dayOfWeek, int32_t time, TimeMode mode, UBool after, UErrorCode &status)
 Sets the DST end rule to a weekday before or after a give date within a month, e.g., the first Monday on or after the 8th. More...
 
virtual int32_t getOffset (uint8_t era, int32_t year, int32_t month, int32_t day, uint8_t dayOfWeek, int32_t millis, UErrorCode &status) const
 Returns the TimeZone's adjusted GMT offset (i.e., the number of milliseconds to add to GMT to get local time in this time zone, taking daylight savings time into account) as of a particular reference date. More...
 
virtual int32_t getOffset (uint8_t era, int32_t year, int32_t month, int32_t day, uint8_t dayOfWeek, int32_t milliseconds, int32_t monthLength, UErrorCode &status) const
 Gets the time zone offset, for current date, modified in case of daylight savings. More...
 
virtual int32_t getOffset (uint8_t era, int32_t year, int32_t month, int32_t day, uint8_t dayOfWeek, int32_t milliseconds, int32_t monthLength, int32_t prevMonthLength, UErrorCode &status) const
 Gets the time zone offset, for current date, modified in case of daylight savings. More...
 
virtual void getOffset (UDate date, UBool local, int32_t &rawOffset, int32_t &dstOffset, UErrorCode &ec) const
 Redeclared TimeZone method. More...
 
virtual void getOffsetFromLocal (UDate date, int32_t nonExistingTimeOpt, int32_t duplicatedTimeOpt, int32_t &rawOffset, int32_t &dstOffset, UErrorCode &status) const
 Get time zone offsets from local wall time. More...
 
virtual int32_t getRawOffset (void) const
 Returns the TimeZone's raw GMT offset (i.e., the number of milliseconds to add to GMT to get local time, before taking daylight savings time into account). More...
 
virtual void setRawOffset (int32_t offsetMillis)
 Sets the TimeZone's raw GMT offset (i.e., the number of milliseconds to add to GMT to get local time, before taking daylight savings time into account). More...
 
void setDSTSavings (int32_t millisSavedDuringDST, UErrorCode &status)
 Sets the amount of time in ms that the clock is advanced during DST. More...
 
virtual int32_t getDSTSavings (void) const
 Returns the amount of time in ms that the clock is advanced during DST. More...
 
virtual UBool useDaylightTime (void) const
 Queries if this TimeZone uses Daylight Savings Time. More...
 
virtual UBool inDaylightTime (UDate date, UErrorCode &status) const
 Returns true if the given date is within the period when daylight savings time is in effect; false otherwise. More...
 
UBool hasSameRules (const TimeZone &other) const
 Return true if this zone has the same rules and offset as another zone. More...
 
virtual TimeZoneclone (void) const
 Clones TimeZone objects polymorphically. More...
 
virtual UBool getNextTransition (UDate base, UBool inclusive, TimeZoneTransition &result) const
 Gets the first time zone transition after the base time. More...
 
virtual UBool getPreviousTransition (UDate base, UBool inclusive, TimeZoneTransition &result) const
 Gets the most recent time zone transition before the base time. More...
 
virtual int32_t countTransitionRules (UErrorCode &status) const
 Returns the number of TimeZoneRules which represents time transitions, for this time zone, that is, all TimeZoneRules for this time zone except InitialTimeZoneRule. More...
 
virtual void getTimeZoneRules (const InitialTimeZoneRule *&initial, const TimeZoneRule *trsrules[], int32_t &trscount, UErrorCode &status) const
 Gets the InitialTimeZoneRule and the set of TimeZoneRule which represent time transitions for this time zone. More...
 
virtual UClassID getDynamicClassID (void) const
 Ove