class RTz : public RSessionBase |
The client interface to the time zone server.
This class performs two basic functions:
1. Converts between UTC time and local time. 2. Sets the current local time zone.
NOTE: The presence of a time zone server will alter the behaviour of the time zone related function calls User::SetUTCOffset() and User::SetUTCTimeAndOffset(). The time zone server is shutdown when the last session (RTz) is closed. Therefore, to maintain consistent time related behaviour, licensees may want to keep a system level time zone server session open at all times.
Exceptional cases occur when a user requests conversion for a non-existent local time or a double local time.
Non-existent local times occur when the local time changes from winter to summer for DST.
For example, 01:59 local time is non-existent on the day of a change to BST in Europe/London since the time changes directly from 12:59:59 to 2:00.
A double local time occurs when the local time changes from summer to winter.
For example, if the time changes at 02:00 AM BST to 01:00 AM GMT then local times between 01:00 and 01:59 occur twice.
The conversion applies the DST offset if the local time value is double and applies the standard UTC offset if the local time does not exists.
This decision makes the conversion process asymmetrical around the discontinuity in the local time when there is a DST change.
An example conversion from a double local time to UTC and from UTC to a double local time is:
01:59 AM BST => 00:59 AM UTC 01:59 AM UTC => 01:59 AM GMT
An example conversion from a non-existent local time to UTC and from UTC to local time is:
01:59 AM GMT => 01:59 AM UTC 01:59 AM UTC => 02:59 AM BST
9.1
Private Member Functions | |
---|---|
TInt | DoConnect() |
TInt | StartServer() |
void | doConvertL(const CTzId &, TTime &, TTzTimeReference) |
void | doConvertL(TTime &, TTzTimeReference) |
Inherited Enumerations | |
---|---|
RHandleBase:TAttributes | |
RSessionBase:TAttachMode |
Private Attributes | |
---|---|
CTzRuleHolder * | iRulesHolder |
Inherited Attributes | |
---|---|
RHandleBase::iHandle |
IMPORT_C TInt | ConvertToLocalTime | ( | TTime & | aTime | ) | const |
TTime & aTime |
IMPORT_C TInt | ConvertToLocalTime | ( | TTime & | aTime, |
const CTzId & | aZone | |||
) | const |
IMPORT_C TInt | ConvertToUniversalTime | ( | TTime & | aTime | ) | const |
TTime & aTime |
IMPORT_C TInt | ConvertToUniversalTime | ( | TTime & | aTime, |
const CTzId & | aZone | |||
) | const |
CTzId * | CreateUserTimeZoneL | ( | const CTzRules & | aTzUserRules, |
const CTzUserNames & | aTzUserNames | |||
) |
const CTzRules & aTzUserRules | |
const CTzUserNames & aTzUserNames |
void | DeleteUserTimeZoneL | ( | const CTzId & | aTzId | ) |
const CTzId & aTzId |
IMPORT_C void | GetOffsetsForTimeZoneIdsL | ( | const RArray< TInt > & | aTzNumericIds, |
RArray< TInt > & | aOffsets | |||
) | const |
IMPORT_C CTzRules * | GetTimeZoneRulesL | ( | const TTime & | aStartTime, |
const TTime & | aEndTime, | |||
TTzTimeReference | aTimeRef | |||
) | const |
const TTime & aStartTime | |
const TTime & aEndTime | |
TTzTimeReference aTimeRef |
IMPORT_C CTzRules * | GetTimeZoneRulesL | ( | const CTzId & | aZone, |
const TTime & | aStartTime, | |||
const TTime & | aEndTime, | |||
TTzTimeReference | aTimeRef | |||
) | const |
const CTzId & aZone | |
const TTime & aStartTime | |
const TTime & aEndTime | |
TTzTimeReference aTimeRef |
void | GetUserTimeZoneIdsL | ( | RPointerArray< CTzId > & | aTzIds | ) | const |
RPointerArray< CTzId > & aTzIds |
CTzUserNames * | GetUserTimeZoneNamesL | ( | const CTzId & | aTzId | ) | const |
const CTzId & aTzId |
IMPORT_C TBool | IsDaylightSavingOnL | ( | CTzId & | aZone | ) | const |
CTzId & aZone |
IMPORT_C TBool | IsDaylightSavingOnL | ( | CTzId & | aZone, |
const TTime & | aUTCTime | |||
) | const |
IMPORT_C void | LocalizationDeleteCityL | ( | const TDesC & | aCityName, |
TInt | aCityTzId | |||
) |
IMPORT_C CTzLocalizedCityRecord * | LocalizationReadCachedTimeZoneCityL | ( | TInt | aFrequentlyUsedZone | ) |
TInt aFrequentlyUsedZone |
IMPORT_C void | LocalizationReadCitiesInGroupL | ( | RPointerArray< CTzLocalizedCityRecord > & | aCities, |
TUint8 | aGroupId | |||
) |
RPointerArray< CTzLocalizedCityRecord > & aCities | |
TUint8 aGroupId |
IMPORT_C void | LocalizationReadCitiesL | ( | RPointerArray< CTzLocalizedCityRecord > & | aCities | ) |
RPointerArray< CTzLocalizedCityRecord > & aCities |
IMPORT_C void | LocalizationReadCitiesL | ( | RPointerArray< CTzLocalizedCityRecord > & | aCities, |
TInt | aTimeZoneId | |||
) |
RPointerArray< CTzLocalizedCityRecord > & aCities | |
TInt aTimeZoneId |
IMPORT_C CTzLocalizedTimeZoneRecord * | LocalizationReadFrequentlyUsedZoneL | ( | TInt | aFrequentlyUsedZone | ) |
TInt aFrequentlyUsedZone |
IMPORT_C void | LocalizationWriteAllFrequentlyUsedZonesL | ( | const RPointerArray< CTzLocalizedTimeZoneRecord > & | aTimeZones, |
const RPointerArray< CTzLocalizedCityRecord > & | aCities | |||
) |
const RPointerArray< CTzLocalizedTimeZoneRecord > & aTimeZones | |
const RPointerArray< CTzLocalizedCityRecord > & aCities |
IMPORT_C void | LocalizationWriteCityL | ( | const TDesC & | aCityName, |
TInt | aCityTzId, | |||
TUint8 | aCityGroupId, | |||
TUint | aCityTzResourceId | |||
) |
IMPORT_C void | LocalizationWriteFrequentlyUsedZoneL | ( | const CTzLocalizedTimeZoneRecord & | aTimeZone, |
const CTzLocalizedCityRecord & | aCity, | |||
TInt | aFrequentlyUsedZone | |||
) |
const CTzLocalizedTimeZoneRecord & aTimeZone | |
const CTzLocalizedCityRecord & aCity | |
TInt aFrequentlyUsedZone |
IMPORT_C void | NotifyHomeTimeZoneChangedL | ( | const NTzUpdate::TTimeZoneChange & | aChange | ) | const |
const NTzUpdate::TTimeZoneChange & aChange |
IMPORT_C void | Panic | ( | TPanic | aPanic | ) | [static] |
This should not be used externally.
TPanic aPanic |
void | RegisterTzChangeNotifier | ( | TRequestStatus & | aStatus | ) | const |
TRequestStatus & aStatus |
IMPORT_C void | SetAutoUpdateBehaviorL | ( | TTzAutoDSTUpdateModes | aUpdateEnabled | ) |
TTzAutoDSTUpdateModes aUpdateEnabled |
IMPORT_C TInt | SetHomeTime | ( | const TTime & | aLocalTime | ) | const |
const TTime & aLocalTime |
IMPORT_C void | SetTimeZoneL | ( | CTzId & | aZone | ) | const |
This should not be used externally.
CTzId & aZone |
IMPORT_C void | SetUnknownZoneTimeL | ( | const TTime & | aUTCTime, |
const TInt | aUTCOffset | |||
) |
IMPORT_C void | SetUnknownZoneTimeL | ( | const TTime & | aUTCTime, |
const TInt | aUTCOffset, | |||
TBool | aPersistInCenRep | |||
) |
IMPORT_C void | SwiObsFileChangedL | ( | TSWIObserverFilterIndex | aType | ) |
TSWIObserverFilterIndex aType |
void | UpdateUserTimeZoneL | ( | const CTzId & | aTzId, |
const CTzRules & | aTzUserRules, | |||
const CTzUserNames & | aTzUserNames | |||
) |
const CTzId & aTzId | |
const CTzRules & aTzUserRules | |
const CTzUserNames & aTzUserNames |
IMPORT_C void | __dbgClearCacheL | ( | TBool | aRestartCaching | ) |
TBool aRestartCaching |
IMPORT_C TInt | __dbgRequestAllocatedCellsL | ( | TInt | aHeapSizeInBytes | ) |
TInt aHeapSizeInBytes |
IMPORT_C void | __dbgSetHeapFailL | ( | RAllocator::TAllocFail | aType, |
TInt | aRate | |||
) |
RAllocator::TAllocFail aType | |
TInt aRate |
void | doConvertL | ( | const CTzId & | aZone, |
TTime & | aTime, | |||
TTzTimeReference | aTimerRef | |||
) | const [private] |
const CTzId & aZone | |
TTime & aTime | |
TTzTimeReference aTimerRef |
void | doConvertL | ( | TTime & | aTime, |
TTzTimeReference | aTimerRef | |||
) | const [private] |
TTime & aTime | |
TTzTimeReference aTimerRef |
Time zone server panic codes.
EPanicServerNotFound = 1 |
This panic indicates that the time zone server has not been found. |
EPanicServerDead |
This panic indicates that the server has died. |
EPanicTimeZoneNameIdNotSet |
This panic indicates that the time zone ID is not set. |
EPanicRulesIndexOutofRange |
This panic indicates that an out of range index was accessed. |
EPanicTimeNotCoveredByRules |
This panic indicates that there are no rules present for this time zone. |
EPanicBadTimeZoneRules |
This panic indicates that the time zone rules are unusable. |
EPanicUnsupportedTimeReference |
This panic indicates that an unsupported time reference has been accessed. |
EPanicUnsupportedTimeZoneNoId |
This panic indicates that the time zone ID is not supported. |
EPanicNotificationRequestPending |
This panic indicates that a request for notification is already pending from the client. |
EPanicInvalidArgument |
This panic indicates that an incorrect data has been sent to the server. |
EPanicBadSchema |
This panic indicates that a table in the user-defined time zone database has not conformed to the declared schema. |
The software install observer plugin can distinguish between changes to the resource files or the rules database. This enumeration indicates the filter index that is used for the resource files and rules database filters. This enum should not be used externally.
EFilterTzPrivate = 0 |
The index of the Tz private directory filter. |
EFilterResourceTimezonelocalization |
The index of the resources filter. |
Automatic DST update mode.
ETZAutoDSTUpdateOff = 0 |
No auto update notification when a DST event occurs. |
ETZAutoDSTUpdateOn |
Automatic time update will occur and the client app will be notified. |
ETZAutoDSTNotificationOnly |
Client app needs to confirm that the time should be updated whenever a DST event occurs. |
Time zone server change events.
ETZDatabaseChanged = 1 |
Used for notifying that the timezone database has changed. |
ETZSystemTimeZoneChanged |
Used for notifying that the system timezone has changed. |
ETZDSTRuleChanged |
Used for notifying that the DST rule has changed. |
ETZAutomaticTimeUpdate |
Used for notifying that an automatic time update has taken place. |
ETZLocalizationDataChanged |
Used for notifying that a change in localization resources has taken place. |