Time Zone
Lloyd
lloyd at cdactvm.in
Tue Jan 2 21:54:47 PST 2007
Thank you Paul. I saw that /usr/share/zoneinfo/zone.tab contains a list
of time zones (This is what I want) like
#country-
#code coordinates TZ comments
AD +4230+00131 Europe/Andorra
AE +2518+05518 Asia/Dubai
AF +3431+06912 Asia/Kabul
AG +1703-06148 America/Antigua
AI +1812-06304 America/Anguilla
....
....
Now what I want is to convert this zone name to its corresponding offset
from UTC.
for example the offset for Asia/Calcutta from UTC is +530. How can get
this +530 from Asia/Calcutta ? Any functions available for this?
Regards,
Lloyd
On Tue, 2007-01-02 at 10:04 -0500, Paul Koning wrote:
> >>>>> "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
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
______________________________________
Scanned and protected by Email scanner
More information about the wx-users
mailing list