×
Namespaces

Variants
Actions

Archived:TimeZone.getTimeZone() returns invalid value for GMT when using daylight saving time (summer time) (Known Issue)

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The article is believed to be still valid for the original topic scope.

Article Metadata
Tested with
Devices(s): Nokia 6630, Nokia 6681, Nokia N70, Nokia N72
CompatibilityArticle
Created: User:Technical writer 1 (22 Nov 2006)
Last edited: hamishwillee (25 Oct 2013)

Contents

Overview

Reading time zone with TimeZone.getTimeZone()function may return invalid value for GMT when using daylight saving time.

Description

Daylight saving time (aka summer time) adds one hour to the standard time and it is used, for example, in most European countries. MIDP implementation in S60 2nd Edition FP2 and FP3 devices does not seem to take the daylight saving time into consideration: when the daylight saving time is used, reading the current GMT-time with TimeZone.getTimeZone() method or using GMT as a reference while setting timeZone offset returns incorrect value for the GMT time.

For example if it is 10:00 am on your time zone where the offset is GMT+3 (with daylight saving), the function would incorrectly return value 8:00 am for GMT instead of the actual 7:00 am.

In tested S60 3rd Edition devices (Nokia N91, Nokia E70) the problem doesn't occur.

How to reproduce

Read the GMT value with the TimeZone.getTimeZone() function and compare to current phone time and the actual GMT time.

Solution

Adjust the offset correspondingly by adding/subtracting an additional hour, depending on the current time zone if daylight saving time is currently in use.

This page was last modified on 25 October 2013, at 06:19.
82 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×