Reputation: 10064
Between Windows XP and Vista (and server 2003 and 2008) Microsoft have removed the Index
key from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones
and guess which value we store in our database to record an employee's time zone...
(See http://support.microsoft.com/kb/935369).
What is the best value to use instead? Microsoft seem to advocate using the name of the registry key for the time zone in question (like HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\GMT Standard Time
) but that feels like magic constants to me.
Is there a value that is guaranteed to be unique and fixed across Windows versions, cultures, translations and localisations?
Upvotes: 1
Views: 1149
Reputation: 88786
Unfortunately, it seems like those magic constants are the best way of identifying those time zones.
In fact, this is exactly what .NET 3.5's TimeZoneInfo class uses as its Id field.
.NET's docs say that it "is a key string that uniquely identifies a particular time zone." implying that it is not localized.
Upvotes: 1