TTsTime Class Reference

class TTsTime

In Task Scheduler TTsTime is used to represent time as either UTC or Local Time. It is used by many of the Task Scheduler API's and also used internally within Task Scheduler. This class is not expected to be stored by Task Scheduler clients.

It provides EXPORTed APIs for constructing, setting and getting UTC and Local Time.

Internally the object always holds time as UTC (using the data member iUTC) irrespective of whether the object is local time based or UTC based.

If the object is local time based iOffset will be set to the system TimeZone/DST offset. When UTC based iOffset will always be 0.

Therefore:

When representing UTC: iUTC contains the UTC time iOffSet is set to 0 iFlags, bit 0 is set to 1

When representing Local Time: iUTC contains the home time minus the TimeZone/DST offset iOffSet contains the TimeZone/DST offset iFlags, bit 0 is set to 0

If an instance of this class is created using the default constructor then: iUTC is set to 0 iOffSet is set to 0 iFlags, bit 0 is set to 1 (indicating UTC time)

Public Member Functions
TTsTime()
TTsTime(const TTime &, TBool)
TTsTime(const TTsTime &)
voidExternalizeL(RWriteStream &)
IMPORT_C const TTimeGetLocalTime()
IMPORT_C TTimeGetLocalTime()
TTimeIntervalSeconds GetOffset()
IMPORT_C const TTime &GetUtcTime()
IMPORT_C const TTime &GetUtcTime()
voidInternalizeL(RReadStream &)
IMPORT_C TBoolIsUtc()
voidProcessOffsetEvent()
IMPORT_C voidSetLocalTime(const TTime &)
IMPORT_C voidSetUtcTime(const TTime &)
IMPORT_C TTsTime &operator=(const TTsTime &)
Private Member Functions
TTime DetermineLocalTime()
Private Attributes
TUint32 iFlags
TTimeIntervalSeconds iOffset
TTime iUtcTime

Constructor & Destructor Documentation

TTsTime()

IMPORT_CTTsTime()

TTsTime(const TTime &, TBool)

IMPORT_CTTsTime(const TTime &aTime,
TBoolaIsUtc
)

Parameters

const TTime & aTime
TBool aIsUtc

TTsTime(const TTsTime &)

IMPORT_CTTsTime(const TTsTime &aTTsTime)

Parameters

const TTsTime & aTTsTime

Member Functions Documentation

DetermineLocalTime()

TTime DetermineLocalTime()const [private]

ExternalizeL(RWriteStream &)

voidExternalizeL(RWriteStream &aStream)const

Parameters

RWriteStream & aStream

GetLocalTime()

IMPORT_C const TTimeGetLocalTime()

GetLocalTime()

IMPORT_C TTimeGetLocalTime()const

GetOffset()

TTimeIntervalSeconds GetOffset()[inline]

GetUtcTime()

IMPORT_C const TTime &GetUtcTime()

GetUtcTime()

IMPORT_C const TTime &GetUtcTime()const

InternalizeL(RReadStream &)

voidInternalizeL(RReadStream &aStream)

Parameters

RReadStream & aStream

IsUtc()

IMPORT_C TBoolIsUtc()const

ProcessOffsetEvent()

voidProcessOffsetEvent()

SetLocalTime(const TTime &)

IMPORT_C voidSetLocalTime(const TTime &aLocalTime)

Parameters

const TTime & aLocalTime

SetUtcTime(const TTime &)

IMPORT_C voidSetUtcTime(const TTime &aUtcTime)

Parameters

const TTime & aUtcTime

operator=(const TTsTime &)

IMPORT_C TTsTime &operator=(const TTsTime &aTsTime)

Parameters

const TTsTime & aTsTime

Member Data Documentation

TUint32 iFlags

TUint32 iFlags[private]

Bit 0 is set to 0 when UTC based, Bit 0 is set to 1 when home time based, Bit1-Bit31 are reserved for future use.

TTimeIntervalSeconds iOffset

TTimeIntervalSeconds iOffset[private]

If the object is UTC based then this will always be 0. If home time based then this will contain the value of system TimeZone/DST offset at the time that the object was created or last updated.

TTime iUtcTime

TTime iUtcTime[private]

This object always stores time as UTC irrespective of whether the object is home time or UTC based.