|
|
|
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(TTimeIntervalSeconds) and User::SetUTCTimeAndOffset(const TTime &,TTimeIntervalSeconds). 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
RHandleBase - A handle to an object.
RSessionBase -
Client-side handle to a session with a server.
RTz - The client interface to the time zone server.
Defined in RTz:
AutoUpdateSettingL()Retrieves the daylight saving auto-update functionality. Close()Closes the connection to the time zone server. Connect()Connects to the time zone server, attempting to start it if necessary. ConvertToLocalTime(TTime &)constConverts a time from UTC to local (wall-clock) time for the current system time ...ConvertToLocalTime(TTime &,const CTzId &)constConverts a time from UTC to the local (wall-clock) time for the specified time z...ConvertToUniversalTime(TTime &)constConverts a local (wall-clock) time for the current system time zone, to UTC. If ...ConvertToUniversalTime(TTime &,const CTzId &)constConverts a local (wall-clock) time for the specified time zone, to UTC. EPanicBadTimeZoneRulesThis panic indicates that the time zone rules are unusable. EPanicInvalidArgumentThis panic indicates that an incorrect data has been sent to the server. EPanicNotificationRequestPendingThis panic indicates that a request for notification is already pending from the...EPanicRulesIndexOutofRangeThis panic indicates that an out of range index was accessed. EPanicServerDeadThis panic indicates that the server has died. EPanicServerNotFoundThis panic indicates that the time zone server has not been found. EPanicTimeNotCoveredByRulesThis panic indicates that there are no rules present for this time zone. EPanicTimeZoneNameIdNotSetThis panic indicates that the time zone ID is not set. EPanicUnsupportedTimeReferenceThis panic indicates that an unsupported time reference has been accessed. EPanicUnsupportedTimeZoneNoIdThis panic indicates that the time zone ID is not supported. ETZAutoDSTNotificationOnlyClient app needs to confirm that the time should be updated whenever a DST event...ETZAutoDSTUpdateOffNo auto update notification when a DST event occurs. ETZAutoDSTUpdateOnAutomatic time update will occur and the client app will be notified. ETZAutomaticTimeUpdateUsed for notifying that an automatic time update has taken place. ETZDSTRuleChangedUsed for notifying that the DST rule has changed. ETZDatabaseChangedUsed for notifying that the timezone database has changed. ETZSystemTimeZoneChangedUsed for notifying that the system timezone database has changed. GetOffsetsForTimeZoneIdsL(const RArray< TInt > &,RArray< TInt > &)constRetrieves the UTC offset for an array of numeric time zone ids. The offset is wr...GetTimeZoneRulesL(const CTzId &,const TTime &,const TTime &,TTzTimeReference)constRetrieves the time zone rules for a specified time zone.GetTimeZoneRulesL(const TTime &,const TTime &,TTzTimeReference)constRetrieves the time zone rules for the current home time zone.IsDaylightSavingOnL(CTzId &)constTells if daylight savings are applied at the specified zone at the current timeIsDaylightSavingOnL(CTzId &,const TTime &)constTells if daylight savings are applied at the specified zone at a specified timeRTz()Constructor. SetAutoUpdateBehaviorL(TTzAutoDSTUpdateModes)Sets the configuration of the UTC Offset auto-update functionality.SetHomeTime(const TTime &)constSets the system time to the given local time. Note that the standard Tz algorith...SetUnknownZoneTimeL(const TTime &,const TInt)Sets the UTC time and the wall-clock offset for a zone not defined in the Timezo...SetUnknownZoneTimeL(const TTime &,const TInt,TBool)Sets the UTC time and the wall-clock offset for a zone not defined in the Timezo...TPanicTTzAutoDSTUpdateModesThese enumerators are to describe different modes of the automatic DST event han...TTzChanges~RTz()Destructor. Calls RTz::Close(). Inherited from RHandleBase:
Attributes()constBTraceId()constReturns a unique object identifier for use with BTrace
Duplicate(const RThread &,TOwnerType)Creates a valid handle to the kernel object for which the specified thread alrea...FullName()constGets the full name of the handle.FullName(TDes &)constGets the full name of the handle.Handle()constRetrieves the handle-number of the object associated with this handle.HandleInfo(THandleInfo *)Gets information about the handle.Name()constGets the name of the handle.Open(const TFindHandleBase &,TOwnerType)Opens a handle to a kernel side object found using a find-handle object.RHandleBase(TInt)Copy constructor.SetHandle(TInt)Sets the handle-number of this handle to the specified value.SetHandleNC(TInt)Sets the handle-number of this handle to the specified value, and marks it as no...iHandleInherited from RSessionBase:
CreateSession(RServer2,const TVersion &)Creates a session with a server, specifying no message slots.CreateSession(RServer2,const TVersion &,TInt)Creates a session with a server.CreateSession(RServer2,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)Creates a session with a server.CreateSession(const TDesC &,const TVersion &)Creates a session with a server, specifying no message slots.CreateSession(const TDesC &,const TVersion &,TInt)Creates a session with a server.CreateSession(const TDesC &,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)Creates a session with a server.CreateSession(const TDesC &,const TVersion &,TInt,TRequestStatus *)EAutoAttachEExplicitAttachOpen(RMessagePtr2,TInt,TOwnerType)Opens a handle to a session using a handle number sent by a client to a server.Open(RMessagePtr2,TInt,const TSecurityPolicy &,TOwnerType)Opens a handle to a session using a handle number sent by a client to a server, ...Open(TInt,TOwnerType)Opens a handle to a session using a handle number passed as an environment data ...Open(TInt,const TSecurityPolicy &,TOwnerType)Opens a handle to a session using a handle number passed as an environment data ...Send(TInt)constIssues a blind request to the server with the specified function number, but wit...Send(TInt,const TIpcArgs &)constIssues a blind request to the server with the specified function number, and arg...SendReceive(TInt)constIssues a synchronous request to the server with the specified function number, b...SendReceive(TInt,TRequestStatus &)constIssues an asynchronous request to the server with the specified function number,...SendReceive(TInt,const TIpcArgs &)constIssues a synchronous request to the server with the specified function number an...SendReceive(TInt,const TIpcArgs &,TRequestStatus &)constIssues an asynchronous request to the server with the specified function number ...SetReturnedHandle(TInt)Sets the handle-number of this handle to the specified value.SetReturnedHandle(TInt,RHandleBase &)SetReturnedHandle(TInt,const TSecurityPolicy &)Sets the handle-number of this session handle to the specified value after valid...ShareAuto()Creates a session that can be shared by other threads in the current process.ShareProtected()Creates a session handle that can be be passed via IPC to another process as wel...TAttachModeIndicates whether or not threads in the process are automatically attached to th...IMPORT_C TInt Connect();
Connects to the time zone server, attempting to start it if necessary.
|
|
IMPORT_C TInt ConvertToLocalTime(TTime &aTime) const;
Converts a time from UTC to local (wall-clock) time for the current system time zone. If caching has been enabled by the CTzConverter class, then the conversion will be done using the cache instead of issuing a request to the server.
|
|
IMPORT_C TInt ConvertToLocalTime(TTime &aTime, const CTzId &aZone) const;
Converts a time from UTC to the local (wall-clock) time for the specified time zone.
|
|
IMPORT_C TInt ConvertToUniversalTime(TTime &aTime) const;
Converts a local (wall-clock) time for the current system time zone, to UTC. If caching has been enabled by the CTzConverter class, then the conversion will be done using the cache instead of issuing a request to the server.
|
|
IMPORT_C TInt ConvertToUniversalTime(TTime &aTime, const CTzId &aZone) const;
Converts a local (wall-clock) time for the specified time zone, to UTC.
|
|
IMPORT_C void GetOffsetsForTimeZoneIdsL(const RArray< TInt > &aTzNumericIds, RArray< TInt > &aOffsets) const;
Retrieves the UTC offset for an array of numeric time zone ids. The offset is written back into aOffsets.
|
IMPORT_C TInt AutoUpdateSettingL();
Retrieves the daylight saving auto-update functionality.
|
IMPORT_C void SetAutoUpdateBehaviorL(TTzAutoDSTUpdateModes aUpdateEnabled);
Sets the configuration of the UTC Offset auto-update functionality.
|
| Capability: | WriteDeviceData |
IMPORT_C TInt SetHomeTime(const TTime &aLocalTime) const;
Sets the system time to the given local time. Note that the standard Tz algorithm is used - in the case of an ambiguous time the first occurance of the given local wall-clock time is chosen.
An example of an ambiguous time: 01:30 wall-clock time on 31/10/2004 in the UK could map to either 01:30 BST (00:30 GMT) or 01:30 GMT, as the clocks would go back at 02:00 BST (01:00 GMT))
|
|
IMPORT_C TBool IsDaylightSavingOnL(CTzId &aZone) const;
Tells if daylight savings are applied at the specified zone at the current time
|
|
IMPORT_C TBool IsDaylightSavingOnL(CTzId &aZone, const TTime &aUTCTime) const;
Tells if daylight savings are applied at the specified zone at a specified time
|
|
IMPORT_C CTzRules* GetTimeZoneRulesL(const TTime &aStartTime, const TTime &aEndTime, TTzTimeReference aTimeRef) const;
Retrieves the time zone rules for the current home time zone.
|
|
IMPORT_C CTzRules* GetTimeZoneRulesL(const CTzId &aZone, const TTime &aStartTime, const TTime &aEndTime, TTzTimeReference
aTimeRef) const;
Retrieves the time zone rules for a specified time zone.
|
|
IMPORT_C void NotifyHomeTimeZoneChangedL(const NTzUpdate::TTimeZoneChange &aChange) const;
Publish notification that the home time zone (as defined in CTzLocalizer) has been changed. This function should only be called from TimeZoneLocalization.
|
IMPORT_C void SetUnknownZoneTimeL(const TTime &aUTCTime, const TInt aUTCOffset);
Sets the UTC time and the wall-clock offset for a zone not defined in the Timezone Database.
This is useful when the client wants to specify the UTC time and the wall-clock offset explicitly rather than using time zones.
This function should be used instead of User::SetUTCOffset(TTimeIntervalSeconds) and User::SetUTCTimeAndOffset(const TTime &,TTimeIntervalSeconds).
If this function has been called the time zone server will use the value returned by User::UTCOffset() as the offset value when doing time conversions. Calling User::SetUTCOffset(TTimeIntervalSeconds) may therefore cause unexpected results.
The fact that the time zone has been set to the unknown time zone is not persisted across time zone server reboots. So it
may be necessary to call this function each time the time zone server is started. If persistence across reboots is desired
the overload RTz::SetUnknownZoneTimeL(const TTime &,const TInt,TBool) should be used.
|
IMPORT_C void SetUnknownZoneTimeL(const TTime &aUTCTime, const TInt aUTCOffset, TBool aPersistInCenRep);
Sets the UTC time and the wall-clock offset for a zone not defined in the Timezone Database.
This is useful when the client wants to specify the UTC time and the wall-clock offset explicitly rather than using time zones.
This function should be used instead of User::SetUTCOffset(TTimeIntervalSeconds) and User::SetUTCTimeAndOffset(const TTime &,TTimeIntervalSeconds).
If this function has been called the time zone server will use the value returned by User::UTCOffset() as the offset value when doing time conversions. Calling User::SetUTCOffset(TTimeIntervalSeconds) may therefore cause unexpected results.
The fact that the time zone has been set to the unknown time zone is persisted across time zone server reboots only if the
aPersistInCenRep argument is set to ETrue. The desired offset however is never persisted (the value returned by User::UTCOffset() is used). So it may be necessary to call this function each time the time zone server is started.
|
TTzAutoDSTUpdateModes
These enumerators are to describe different modes of the automatic DST event handling.
These are used both as arguments for the API SetAutoUpdateBehaviorL, and as notifications for the publish and subscribe.
|
TTzChanges
|
TPanic
|