Time Zone
Paul Koning
pkoning at equallogic.com
Tue Jan 2 07:04:13 PST 2007
>>>>> "lloyd" == lloyd <lloyd at cdactvm.in> writes:
lloyd> Hi, I would like to read the time zone information from the
lloyd> user. Does anybody know an easy way for this? (Like one
lloyd> available in Windows and Linux ). I would like to read it from
lloyd> the bitmap (time zone map) as well as from a combo box. From
lloyd> where to I can get the time zone list? (I made a preliminary
lloyd> search in Internet)
Timezone stuff is much harder than it seems. There are lots of
shorcuts that get you in trouble.
On Unix systems, the full list of timezones is in the file system tree
at /usr/share/zoneinfo. And the timezone setting is a filename
relative to that subtree, for example US/Eastern or Asia/Calcutta. I
don't know where the map comes from.
Windows seems to have a subset of the full set of zones. The problem
with a subset is that you end up not being able to represent the time
rules for a given country or part of a country. The offset from UTC
isn't the problem -- the problem is in the rules for when "daylight
savings time" ("summer time") starts and ends, or whether there is any
at all. There are only about 30 different UTC offsets in the world,
but several hundred summer time rulesets. That's why there are so
many entries under /usr/share/zoneinfo...
If I had to do this, I'd either ask the user for a zone name, then
validate it against the zoneinfo tree, or I'd offer up a listbox
populated from a walk of that tree. Or perhaps a tree control?
paul
More information about the wx-users
mailing list