|
||
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 &)const
Converts a time from UTC to local (wall-clock) time for the current system time ...ConvertToLocalTime(TTime &,const CTzId &)const
Converts a time from UTC to the local (wall-clock) time for the specified time z...ConvertToUniversalTime(TTime &)const
Converts a local (wall-clock) time for the current system time zone, to UTC. If ...ConvertToUniversalTime(TTime &,const CTzId &)const
Converts a local (wall-clock) time for the specified time zone, to UTC. EPanicBadTimeZoneRules
This panic indicates that the time zone rules are unusable. EPanicInvalidArgument
This panic indicates that an incorrect data has been sent to the server. EPanicNotificationRequestPending
This panic indicates that a request for notification is already pending from the...EPanicRulesIndexOutofRange
This panic indicates that an out of range index was accessed. EPanicServerDead
This panic indicates that the server has died. EPanicServerNotFound
This panic indicates that the time zone server has not been found. EPanicTimeNotCoveredByRules
This panic indicates that there are no rules present for this time zone. EPanicTimeZoneNameIdNotSet
This panic indicates that the time zone ID is not set. EPanicUnsupportedTimeReference
This panic indicates that an unsupported time reference has been accessed. EPanicUnsupportedTimeZoneNoId
This panic indicates that the time zone ID is not supported. ETZAutoDSTNotificationOnly
Client app needs to confirm that the time should be updated whenever a DST event...ETZAutoDSTUpdateOff
No auto update notification when a DST event occurs. ETZAutoDSTUpdateOn
Automatic time update will occur and the client app will be notified. ETZAutomaticTimeUpdate
Used for notifying that an automatic time update has taken place. ETZDSTRuleChanged
Used for notifying that the DST rule has changed. ETZDatabaseChanged
Used for notifying that the timezone database has changed. ETZSystemTimeZoneChanged
Used for notifying that the system timezone database has changed. GetOffsetsForTimeZoneIdsL(const RArray< TInt > &,RArray< TInt > &)const
Retrieves the UTC offset for an array of numeric time zone ids. The offset is wr...GetTimeZoneRulesL(const CTzId &,const TTime &,const TTime &,TTzTimeReference)const
Retrieves the time zone rules for a specified time zone.GetTimeZoneRulesL(const TTime &,const TTime &,TTzTimeReference)const
Retrieves the time zone rules for the current home time zone.IsDaylightSavingOnL(CTzId &)const
Tells if daylight savings are applied at the specified zone at the current timeIsDaylightSavingOnL(CTzId &,const TTime &)const
Tells 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 &)const
Sets 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...TPanic
TTzAutoDSTUpdateModes
These enumerators are to describe different modes of the automatic DST event han...TTzChanges
~RTz()
Destructor. Calls RTz::Close(). Inherited from RHandleBase
:
Attributes()const
BTraceId()const
Returns 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()const
Gets the full name of the handle.FullName(TDes &)const
Gets the full name of the handle.Handle()const
Retrieves the handle-number of the object associated with this handle.HandleInfo(THandleInfo *)
Gets information about the handle.Name()const
Gets 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...iHandle
Inherited 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 *)
EAutoAttach
EExplicitAttach
Open(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)const
Issues a blind request to the server with the specified function number, but wit...Send(TInt,const TIpcArgs &)const
Issues a blind request to the server with the specified function number, and arg...SendReceive(TInt)const
Issues a synchronous request to the server with the specified function number, b...SendReceive(TInt,TRequestStatus &)const
Issues an asynchronous request to the server with the specified function number,...SendReceive(TInt,const TIpcArgs &)const
Issues a synchronous request to the server with the specified function number an...SendReceive(TInt,const TIpcArgs &,TRequestStatus &)const
Issues 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...TAttachMode
Indicates 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
|