diff -r 80ef3a206772 -r 48780e181b38 Symbian3/SDK/Source/GUID-237E0861-EC1B-41DA-BDB0-1DEB50620CC8.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-237E0861-EC1B-41DA-BDB0-1DEB50620CC8.dita Tue Jul 20 12:00:49 2010 +0100 @@ -0,0 +1,34 @@ + + + + + +Converting +from UTC to local time in a non-system time zone + +The following code fragment converts a randomly chosen UTC time +to local time for London: +

_LIT8( KEuropeLondon,"Europe/London" ); +// Create a pointer to the time zone id. +// This is the time zone for the local time to which you wish to convert. +CTzId* myZoneId = CTzId::NewL( KEuropeLondon ); +CleanupStack::PushL( myZoneId );// Create a client interface object to the time zone server +RTz myTZoneServer; +// Connect to the time zone server, leaves if fails to connect +User::LeaveIfError( myTZoneServer.Connect() ); +CleanupClosePushL( myTZoneServer );// Create a converter object. +CTzConverter* myConverter = CTzConverter::NewL( myTZoneServer ); +CleanupStack::PushL( myConverter );_LIT8( KMyTime,"20050328:185600.00" ); // UTC time to convert (28 March 2005 18:56 hrs). +TTime myTime( KMyTime ); // Create the time as a TTime object// Convert UTC to local time in Europe/London time zone. +myConverter->ConvertToLocalTime( myTime, *myZoneId ); +// myTime is updated to hold the local time value.// Clean up +CleanupStack::PopAndDestroy(3);// causes myTZoneServer.Close() to be called

+
+
+
\ No newline at end of file