TTzRule Class Reference

#include <mw/vtzrules.h>

Link against: tzclient.lib

class TTzRule

Detailed Description

Encapsulates one time zone rule.

Member Attribute Documentation

iDayOfMonth

TUint8 iDayOfMonth

iDayOfWeek

TUint8 iDayOfWeek

iDayRule

TTzRuleDay iDayRule

iFrom

iMonth

TMonth iMonth

iNewLocalTimeOffset

TInt16 iNewLocalTimeOffset

iOldLocalTimeOffset

TInt16 iOldLocalTimeOffset

iReserved

TUint32 iReserved

iTimeOfChange

TUint16 iTimeOfChange

iTimeReference

TTzTimeReference iTimeReference

iTo

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.

ParameterDescription
aFromYearThe first year in which the rule applies.
aToYearThe last year in which the rule applies.
aOldOffsetThe UTC offset in minutes which applies before the DST change.
aNewOffsetThe UTC offset in minutes which applies after the DST change.
aMonthThe month in which the DST change occurs.
aDayRuleThe rule defining on which day the DST change takes place.
aDayOfMonthThe number of the day within the month, offset from zero. Used in conjunction with aDayRule to define the day where DST changes.
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.
aTimeReferenceDefines whether aTimeOfChange is a local (wall-clock) time or a UTC time.
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.

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.

ParameterDescription
aFromYearThe first date at which the rule applies.
aToYearThe last date at which the rule applies.
aOldOffsetThe UTC offset in minutes which applies before the DST change.
aNewOffsetThe UTC offset in minutes which applies after the DST change.
aMonthThe month in which the DST change occurs.
aDayRuleThe rule defining on which day the DST change takes place.
aDayOfMonthThe number of the day within the month, offset from zero. Used in conjunction with aDayRule to define the day when DST changes.
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.
aTimeReferenceDefines whether aTimeOfChange is a local (wall-clock) time or a UTC time.
aTimeOfChangeThe time of the DST change in minutes from midnight.

Member Function 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.

Deprecated

See also: TVTzActualisedRule TTzRule::ActualiseL(TInt aYear) const

ParameterDescription
aYearYear to actualise time rules

Returns: The time zone rule with the precise date and time for the given year.

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
ParameterDescription
aYearYear to actualise time rules

Returns: The time zone rule with the precise date and time for the given year.

ExternalizeL ( RWriteStream & )

voidExternalizeL(RWriteStream &aStream)const

Externalises a time zone rule to a write stream.

ParameterDescription
aStreamStream to which the object should be externalised.

InternalizeL ( RReadStream & )

voidInternalizeL(RReadStream &aStream)

Internalizes a time zone rule from a read stream.

ParameterDescription
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.

ParameterDescription
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.
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.

Returns: ETrue if the rule applies during the supplied time range, EFalse otherwise.