Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <vtzrules.h>
Link against: tzclient.lib

Class CTzRules

class CTzRules : public CBase;

Description

Encapsulates a collection of time zone rules, and includes the period covered by the rules and the standard time offset at the start of that period.

Derivation

Members

Defined in CTzRules:

Inherited from CBase:


Construction and destruction


NewL()

IMPORT_C static CTzRules* NewL();

Description

Creates a new time zone rules object.

Return value

CTzRules *

Pointer to the time zone rules.


NewL(TInt,TInt)

IMPORT_C static CTzRules* NewL(TInt aStartYear, TInt aEndYear);

Description

Creates a new time zone rules object.

Parameters

TInt aStartYear

The first year in which these time zone rules apply.

TInt aEndYear

The last year in which these time zone rules apply.

Return value

CTzRules *

Pointer to the time zone rules.


NewL(RReadStream &)

IMPORT_C static CTzRules* NewL(RReadStream &aStream);

Description

Creates a new time zone rules object from a stream.

Parameters

RReadStream &aStream

Stream with the time zone rules to be used to create a CTzRules object.

Return value

CTzRules *

Pointer to the time zone rules.


~CTzRules()

IMPORT_C ~CTzRules();

Description

Destructor.

[Top]


Member functions


RulesApply(const TTime &)const

IMPORT_C TBool RulesApply(const TTime &aTime) const;

Description

Queries the time zone rule set to see if they apply to a specified time.

Parameters

const TTime &aTime

The time to be checked, using the same time reference used when constructing CTzRules.

Return value

TBool

ETrue if the time zone rules apply to the specified time. EFalse if not.


AddRuleL(TTzRule)

IMPORT_C void AddRuleL(TTzRule aRule);

Description

Adds a time zone rule to this set.

Parameters

TTzRule aRule

The rule to be added.


RemoveRule(TInt)

IMPORT_C void RemoveRule(TInt aIndex);

Description

Removes a time zone rule from this set.

Parameters

TInt aIndex

The index of the rule to be removed.


operator[](TInt)

IMPORT_C TTzRule& operator[](TInt aIndex);

Description

Gets a time zone rule from this set.

Parameters

TInt aIndex

The index of the rule to be fetched.

Return value

TTzRule &

Reference to the time zone rule.


Count()const

IMPORT_C TInt Count() const;

Description

Gets the number of time zone rules (TTzRules) in this set.

Return value

TInt

The number of rules.


StartYear()const

IMPORT_C TInt StartYear() const;

Description

Gets the first year in which the time zone rules apply.

Return value

TInt

The year.


EndYear()const

IMPORT_C TInt EndYear() const;

Description

Gets the last year in which the time zone rules apply.

Return value

TInt

The year.


SetStartYear(TInt)

IMPORT_C void SetStartYear(TInt aYear);

Description

Sets the first year in which the time zone rules apply.

Parameters

TInt aYear

The year.


SetEndYear(TInt)

IMPORT_C void SetEndYear(TInt aYear);

Description

Sets the last year in which the time zone rules apply.

Parameters

TInt aYear

The year.


ExternalizeL(RWriteStream &)const

IMPORT_C void ExternalizeL(RWriteStream &aStream) const;

Description

Externalises time zone rules to a write stream.

Parameters

RWriteStream &aStream

Stream to which the object should be externalised.

Leave codes

KErrArgument

if the output stream size is invalid


InternalizeL(RReadStream &)

IMPORT_C void InternalizeL(RReadStream &aStream);

Description

Internalizes time zone rules from a read stream.

Parameters

RReadStream &aStream

Stream from which the object should be internalised.


InitialStdTimeOffset()const

IMPORT_C TInt InitialStdTimeOffset() const;

Description

Gets the initial UTC offset for this set of time zone rules.

Return value

TInt

The offset in minutes.


SetInitialStdTimeOffset(TInt)

IMPORT_C void SetInitialStdTimeOffset(TInt aOffset);

Description

Sets the initial UTC offset for this set of time zone rules.

Parameters

TInt aOffset

The offset in minutes.


ConvertToUtcL(TTime &)const

IMPORT_C void ConvertToUtcL(TTime &aLocalTime) const;

Description

Converts the received local time to UTC time.

Parameters

TTime &aLocalTime

The time to convert. On return, this contains the converted time.


ConvertToLocalL(TTime &)const

IMPORT_C void ConvertToLocalL(TTime &aUtcTime) const;

Description

Converts the received UTC time to local time.

Parameters

TTime &aUtcTime

The time to convert. On return, this contains the converted time.


CloneL()const

Capability: Illegal

IMPORT_C CTzRules* CloneL() const;

Description

Creates a copy of these timezone rules.

Return value

CTzRules *

A pointer to the CTzRules copy.


IsEqualTo(const CTzRules &)const

Capability: Illegal

IMPORT_C TBool IsEqualTo(const CTzRules &aRules) const;

Description

Compares two sets of timezone rules.

Parameters

const CTzRules &aRules

The timezone rules to compare with.

Return value

TBool

ETrue if the rules are identical. EFalse if not.


GetActualisedRulesL(CVTzActualisedRules &)const

IMPORT_C void GetActualisedRulesL(CVTzActualisedRules &aActRules) const;

Description

Get actualised rules for time zone rules.

Parameters

CVTzActualisedRules &aActRules

Actualised rules for time zone rules.


ConvertTime(CVTzActualisedRules &,TTime &,TTzTimeReference)const

IMPORT_C TInt ConvertTime(CVTzActualisedRules &aRules, TTime &aTime, TTzTimeReference aTimerRef) const;

Description

Converts between local (wall-clock) and UTC times.

Parameters

CVTzActualisedRules &aRules

The actualised rules to use.

TTime &aTime

The time to convert, specified by aTimerRef if the time is in UTC or local time. On return, it will contain the converted time from UTC to local time or vice versa, depending on aTimerRef's value.

TTzTimeReference aTimerRef

What aTime is expressed in.

Return value

TInt

KErrNone if successful, otherwise KErrNotSupported or KErrNotFound