Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 198
  • Last Modified:

Time zones dilemma

I am doing an application in which the time zones (TZ) will have to be translated from local language (English) to French, Spanish...and so on. In order to have a list of TZ, I accessed the registry to gather all specific time zone informations in this REG key (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Time Zones).  

Since this information is recorded in the language of my Windows version (English TZ info for English version...), I have gather the full list of TZ in English from the registry and have translated them in all other required language.  Now I am trying to find a way create a relationship between all these translated TZ.

(GMT-05:00) Eastern Time (US & Canada) in english is translated to (GMT-05:00) Est (USA et Canada) in French.

In my application, I don't want to refer to a string like these ones but I would like to refer to some invariable values from wich I could link all time zones.

By browsing the registry, I have found, I think, an other key from which I could build this relationship but I am not sure.  The key is MapID. These keys are composed with two numbers separeted with a coma like (38,39).  They seems to be unique (exept for (GMT+/-12:00)) but I don't understand the meaning of these numbers and are they the same on all Windows version (language and build: 95 to XP).

So the questions are:

Could somebody explain what is the relationship between these numbers and the TZ?
Is this approach is the good one to uniquely identify all time zones on all version of Windows?
Could the information recorded in the time zone registry key (bias, daylight saving time...) could be change in the future for some political or geographical reason or are these time zone informations are fixed and "eternal".

Thank you.

Francois Leduc
0
Fled
Asked:
Fled
2 Solutions
 
ginsonicCommented:
0
 
Mohammed NasmanSoftware DeveloperCommented:
Hello

  Look at Win 32 SDK reference that comes with Delphi, and look at these APIs: GetTimeFormat, SetTimeZoneInformation, GetTimeZoneInformation and TTimeZoneInformation type, mabye that will help you

  I haven't tried them before
0
 
LukA_YJKCommented:
Maybe these values are latitude and longitude ? Very stupid idea, though...
0
 
jfstepheCommented:
Fled - did you get anywhere with this? I'm developing a VC++ application using Time Zone stuff and have come across a problem between NT 4 and 2000. Windows 2000 has an Index item in the registry entry to identify the time zone (rather than relying on the string representation), but NT doesn't. To make matters worse NT and 2000 don't have the same string representations for the same time zone!!

From what I can see Map IDs are not unique across the time zones and for those who MapIDs are the same the Time Zone Information (TZI - which includes the daylight savings information etc) differs.

Have you managed to uniquely ID the TZ on NT? (except from using the TZ name?)

Thanks
John
0
 
kacorretiredCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:
       to split points between ginsonic and mnasman
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Merry Christmas and happy new year!

kacor
EE Cleanup Volunteer
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now