SimpleTimeZone
is a concrete subclass ofTimeZone
that represents a time zone for use with a Gregorian calendar
SimpleTimeZone
is a concrete subclass ofTimeZone
that represents a time zone for use with a Gregorian calendar. This class does not handle historical changes.When specifying daylight-savings-time begin and end dates, use a negative value for
dayOfWeekInMonth
to indicate thatSimpleTimeZone
should count from the end of the month backwards. For example, in the U.S., Daylight Savings Time ends at the last (dayOfWeekInMonth = -1) Sunday in October, at 2 AM in standard time.
Various types of daylight-savings time rules can be specfied by using different
values for startDay and startDayOfWeek and endDay and endDayOfWeek. For a
complete explanation of how these parameters work, see the documentation for
setStartRule().
SimpleTimeZone& operator=(const SimpleTimeZone& right)
virtual ~SimpleTimeZone()
virtual bool_t operator==(const TimeZone& that) const
SimpleTimeZone(int32_t rawOffset, const UnicodeString& ID)
ID - The timezone ID which is obtained from
TimeZone.getAvailableIDs. SimpleTimeZone(int32_t rawOffset, const UnicodeString& ID, int8_t startMonth, int8_t startDayOfWeekInMonth, int8_t startDayOfWeek, int32_t startTime, int8_t endMonth, int8_t endDayOfWeekInMonth, int8_t endDayOfWeek, int32_t endTime, UErrorCode& status)
ID - The new SimpleTimeZone's time zone ID.
startMonth - The daylight savings starting month. Month is
0-based. eg, 0 for January.
startDay - The daylight savings starting
day-of-week-in-month. See setStartRule() for a
complete explanation.
startDayOfWeek - The daylight savings starting day-of-week. See setStartRule()
for a complete explanation.
startTime - The daylight savings starting time, expressed as the
number of milliseconds after midnight.
endMonth - The daylight savings ending month. Month is
0-based. eg, 0 for January.
endDay - The daylight savings ending day-of-week-in-month.
See setStartRule() for a complete explanation.
endDayOfWeek - The daylight savings ending day-of-week. See setStartRule()
for a complete explanation.
endTime - The daylight savings ending time, expressed as the
number of milliseconds after midnight.
status - An UErrorCode to receive the status. void setStartYear(int32_t year)
void setStartRule(int32_t month, int32_t dayOfWeekInMonth, int32_t dayOfWeek, int32_t time, UErrorCode& status)
dayOfWeekInMonth - the daylight savings starting
day-of-week-in-month. Please see the member description for an example.
dayOfWeek - the daylight savings starting day-of-week. Please see
the member description for an example.
time - the daylight savings starting time. Please see the member
description for an example.
status - An UErrorCode void setStartRule(int32_t month, int32_t dayOfMonth, int32_t time, UErrorCode& status)
dayOfMonth - The date in that month (1-based).
time - The time of that day (number of millis after midnight)
when DST takes effect in local wall time, which is
standard time in this case.
status - An UErrorCode void setStartRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek, int32_t time, bool_t after, UErrorCode& status)
dayOfMonth - A date within that month (1-based).
dayOfWeek - The day of the week on which this rule occurs.
time - The time of that day (number of millis after midnight)
when DST takes effect in local wall time, which is
standard time in this case.
after - If true, this rule selects the first dayOfWeek on
or after dayOfMonth. If false, this rule selects
the last dayOfWeek on or before dayOfMonth.
status - An UErrorCode void setEndRule(int32_t month, int32_t dayOfWeekInMonth, int32_t dayOfWeek, int32_t time, UErrorCode& status)
. setEndRule(TimeFields.OCTOBER, -1, TimeFields.SUNDAY, 2*60*60*1000);
Various other types of rules can be specified by manipulating the dayOfWeek
and dayOfWeekInMonth parameters. For complete details, see the documentation
for setStartRule().
dayOfWeekInMonth - the daylight savings ending
day-of-week-in-month. See setStartRule() for a complete explanation.
dayOfWeek - the daylight savings ending day-of-week. See setStartRule()
for a complete explanation.
time - the daylight savings ending time. Please see the member
description for an example.
status - An UErrorCode void setEndRule(int32_t month, int32_t dayOfMonth, int32_t time, UErrorCode& status)
dayOfMonth - The date in that month (1-based).
time - The time of that day (number of millis after midnight)
when DST ends in local wall time, which is daylight
time in this case.
status - An UErrorCode void setEndRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek, int32_t time, bool_t after, UErrorCode& status)
dayOfMonth - A date within that month (1-based).
dayOfWeek - The day of the week on which this rule occurs.
time - The time of that day (number of millis after midnight)
when DST ends in local wall time, which is daylight
time in this case.
after - If true, this rule selects the first dayOfWeek on
or after dayOfMonth. If false, this rule selects
the last dayOfWeek on or before dayOfMonth.
status - An UErrorCode 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
year - The reference date's year
month - The reference date's month (0-based; 0 is January)
day - The reference date's day-in-month (1-based)
dayOfWeek - The reference date's day-of-week (1-based; 1 is Sunday)
millis - The reference date's milliseconds in day, UTT (NOT local time).
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
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.
monthLength - the length of the given month in days.
virtual int32_t getRawOffset(void) const
virtual void setRawOffset(int32_t offsetMillis)
void setDSTSavings(int32_t millisSavedDuringDST, UErrorCode& status)
int32_t getDSTSavings(void) const
virtual bool_t useDaylightTime(void) const
virtual bool_t inDaylightTime(UDate date, UErrorCode& status) const
bool_t hasSameRules(const TimeZone& other) const
virtual TimeZone* clone(void) const
virtual UClassID getDynamicClassID(void) const
static UClassID getStaticClassID(void)
. Base* polymorphic_pointer = createPolymorphicObject();
. if (polymorphic_pointer->getDynamicClassID() ==
. Derived::getStaticClassID()) ...
alphabetic index hierarchy of classes
this page has been generated automatically by doc++
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de