TTzRule Class Reference

class TTzRule

Encapsulates one time zone rule.

Constructor & Destructor Documentation

TTzRule(TInt16, TInt16, TInt16, TInt16, TMonth, TTzRuleDay, TUint8, TUint8, TTzTimeReference, TUint16)

IMPORT_CTTzRule(TInt16aFromYear,
TInt16aToYear,
TInt16aOldOffset,
TInt16aNewOffset,
TMonthaMonth,
TTzRuleDayaDayRule,
TUint8aDayOfMonth,
TUint8aDayOfWeek,
TTzTimeReferenceaTimeReference,
TUint16aTimeOfChange
)

Constructor for a time zone rule.

Parameters

TInt16 aFromYearThe first year in which the rule applies.
TInt16 aToYearThe last year in which the rule applies.
TInt16 aOldOffsetThe UTC offset in minutes which applies before the DST change.
TInt16 aNewOffsetThe UTC offset in minutes which applies after the DST change.
TMonth aMonthThe month in which the DST change occurs.
TTzRuleDay aDayRuleThe rule defining on which day the DST change takes place.
TUint8 aDayOfMonthThe number of the day within the month, offset from zero. Used in conjunction with aDayRule to define the day where DST changes.
TUint8 aDayOfWeekThe number of the day within the week, the numerical equivalent of a TDay value. Used in conjunction with aDayRule to define the day where DST changes.
TTzTimeReference aTimeReferenceDefines whether aTimeOfChange is a local (wall-clock) time or a UTC time.
TUint16 aTimeOfChangeThe time of the DST change in minutes from midnight.

TTzRule()

IMPORT_CTTzRule()

Default constructor for a time zone rule.

All member variables are set to zero values.

TTzRule(const TTzRule &)

IMPORT_CTTzRule(const TTzRule &aRule)

Copy constructor for a time zone rule.

Parameters

const TTzRule & aRule

TTzRule(TTimeWithReference, TTimeWithReference, TInt16, TInt16, TMonth, TTzRuleDay, TUint8, TUint8, TTzTimeReference, TUint16)

IMPORT_CTTzRule(TTimeWithReferenceaFromYear,
TTimeWithReferenceaToYear,
TInt16aOldOffset,
TInt16aNewOffset,
TMonthaMonth,
TTzRuleDayaDayRule,
TUint8aDayOfMonth,
TUint8aDayOfWeek,
TTzTimeReferenceaTimeReference,
TUint16aTimeOfChange
)

Constructor for a time zone rule.

Parameters

TTimeWithReference aFromYearThe first date at which the rule applies.
TTimeWithReference aToYearThe last date at which the rule applies.
TInt16 aOldOffsetThe UTC offset in minutes which applies before the DST change.
TInt16 aNewOffsetThe UTC offset in minutes which applies after the DST change.
TMonth aMonthThe month in which the DST change occurs.
TTzRuleDay aDayRuleThe rule defining on which day the DST change takes place.
TUint8 aDayOfMonthThe number of the day within the month, offset from zero. Used in conjunction with aDayRule to define the day when DST changes.
TUint8 aDayOfWeekThe number of the day within the week, the numerical equivalent of a TDay value. Used in conjunction with aDayRule to define the day where DST changes.
TTzTimeReference aTimeReferenceDefines whether aTimeOfChange is a local (wall-clock) time or a UTC time.
TUint16 aTimeOfChangeThe time of the DST change in minutes from midnight.

Member Functions Documentation

Actualise(TInt)

IMPORT_C TVTzActualisedRuleActualise(TIntaYear)const

Resolves the date rule to the precise date and time for the given year, and returns it in a TVTzActualisedRule

For day rules ETzDayAfterDate & ETzDayBeforeDate, the reference date entered is inclusive in the calculation. ie. If the reference date fits the criteria, the reference date will be returned.

eg. Actualise(Friday, ETzDayAfterDate, Fri Jun 22, 2007) returns Jun 22, 2007.

Deprecated. Use TVTzActualisedRule TTzRule::ActualiseL instead.

TVTzActualisedRule TTzRule::ActualiseL(TInt aYear) const

Parameters

TInt aYearYear to actualise time rules

ActualiseL(TInt)

IMPORT_C TVTzActualisedRuleActualiseL(TIntaYear)const

Resolves the date rule to the precise date and time for the given year, and returns it in a TVTzActualisedRule

For day rules ETzDayAfterDate & ETzDayBeforeDate, the reference date entered is inclusive in the calculation. ie. If the reference date fits the criteria, the reference date will be returned.

eg. Actualise(Friday, ETzDayAfterDate, Fri Jun 22, 2007) returns Jun 22, 2007.

leave
KErrCorrupt if the current day rule is not one of the defined values in TTzRuleDay

Parameters

TInt aYearYear to actualise time rules

ExternalizeL(RWriteStream &)

voidExternalizeL(RWriteStream &aStream)const

Externalises a time zone rule to a write stream.

Parameters

RWriteStream & aStreamStream to which the object should be externalised.

InternalizeL(RReadStream &)

voidInternalizeL(RReadStream &aStream)

Internalizes a time zone rule from a read stream.

Parameters

RReadStream & aStreamStream from which the object should be internalised.

RuleApplies(const TTime &, const TTime &)

TBool RuleApplies(const TTime &aStart,
const TTime &aEnd
)const

Check if a time zone rule is applicable during a time range.

Parameters

const TTime & aStartStart of time range, inclusively. ie. For a rule to be applicable, this time can be equal to or earlier than the rule's end time. This time should use the same time reference used when TTzRule is constructed.
const TTime & aEndEnd of time range, exclusively. ie. In order for a rule to be applicable, this time must be later than the rule's start time. This time should use the same time reference used when TTzRule is constructed.

Member Data Documentation

TUint8 iDayOfMonth

TUint8 iDayOfMonth

TUint8 iDayOfWeek

TUint8 iDayOfWeek

TTzRuleDay iDayRule

TTzRuleDay iDayRule

TTimeWithReference iFrom

TTimeWithReference iFrom

TMonth iMonth

TMonth iMonth

TInt16 iNewLocalTimeOffset

TInt16 iNewLocalTimeOffset

TInt16 iOldLocalTimeOffset

TInt16 iOldLocalTimeOffset

TUint32 iReserved

TUint32 iReserved

TUint16 iTimeOfChange

TUint16 iTimeOfChange

TTzTimeReference iTimeReference

TTzTimeReference iTimeReference

TTimeWithReference iTo

TTimeWithReference iTo