diff -r 89d6a7a84779 -r 25a17d01db0c Symbian3/PDK/Source/GUID-91E0E87B-FECA-5D19-AD48-9DEFD42B86B3.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-91E0E87B-FECA-5D19-AD48-9DEFD42B86B3.dita Fri Jan 22 18:26:19 2010 +0000 @@ -0,0 +1,44 @@ + + + + + +How +to implement universal time and home timeAdd universal time offset to display the home time. +

These code fragments demonstrate the various components which make up the +time, including:

+ +
Home time

In the following example code fragment, +the universal time offset is added to the universal time, giving the home +time. The universal time offset is determined +by the time zone, and by whether daylight savings is currently in effect. +The offset is in seconds from universal time; this is positive +for time zones east of universal time, and negative for time zones west of +universal time. Home time is the same time as a wall clock would show, and +it is not necessary to consider daylight savings independently of the time +zone.

TTime time; + + // Get Universal time +time.UniversalTime(); + + // Get Universal time offset +TTimeIntervalSeconds universalTimeOffset(User::UTCOffset()); + + // Add locale's universal time offset to universal time + // to get the home time +time+=universalTimeOffset;

time now contains +the home time. This may be tested by calling TTime::HomeTime(), +which should give the same result.

TTime homeTime; +homeTime.HomeTime(); // homeTime==time
+
\ No newline at end of file