This tutorial describes how a device creator creates a user-defined time zone using CTzUserData .
The high-level steps to create a user-defined time zone are described in Procedure section:An illustration of the procedure is given below. Note that cleanup stack management and CTzRules object creation details are omitted for clarity.
#include <tz.h> // For CTzUserData etc. #include <…> ... // These strings would typically be supplied by the UI layer. _LIT( KTzUserStdName, ”Mountain Standard Time” ); _LIT( KTzUserShortStdName, ”MST” ); _LIT( KTzUserDstName, ”Mountain Daylight Time” ); _LIT( KTzUserShortDstName, ”MDT” ); _LIT( KTzUserCityName, ”Window Rock” ); _LIT( KTzUserRegionName, ”America” ); // Create TZ rules object. CTzRules* tzRules = ...; // Create TZ names object. CTzUserNames* tzNames = CTzUserNames::NewL( KTzUserStdName, KTzUserShortStdName, KTzUserDstName, KTzUserShortDstName, KTzUserCityName, KTzUserRegionName ); // Connect to TZ Server. RTz tzServer; User::LeaveIfError( tzServer.Connect() ); // Create user-defined TZ. CTzUserData* tzUserData = CTzUserData::NewL( tzServer ); CTzId* userTzId = tzUserData->CreateL( *tzRules, *tzNames ); ...
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.