Thread: win32 timezone map

win32 timezone map

From
"Magnus Hagander"
Date:
Per discussion off-list with Tom, here is a patch to redo the way the
system timezone is detected on win32. Instead of trying to figure out
what to do, it just looks in a lookup table for all available timezones
(there is a finite and stable number of timezones on a win32 system,
unlike unixes that can have timezones added manually in most cases).

I've tried to match the timezones as good as I could using the city
names from the win32 descriptions and using some google. There are
probably some that can have better mappings - local knowledge is
probably the key there.

In passing the patch also removes some of the kludges put in the tz
detection code that were specific for win32.

//Magnus


Re: win32 timezone map

From
Tom Lane
Date:
"Magnus Hagander" <mha@sollentuna.net> writes:
> Per discussion off-list with Tom, here is a patch to redo the way the
> system timezone is detected on win32.

Er ... no patch attached?

            regards, tom lane

Re: win32 timezone map

From
"Magnus Hagander"
Date:
>> Per discussion off-list with Tom, here is a patch to redo the way the
>> system timezone is detected on win32.
>
>Er ... no patch attached?

Heh. Oops.

//Magnus

Attachment

Re: win32 timezone map

From
Tom Lane
Date:
"Magnus Hagander" <mha@sollentuna.net> writes:
> Per discussion off-list with Tom, here is a patch to redo the way the
> system timezone is detected on win32.

Applied, along with some marginal hacking on the non-Windows case.
I extended the search back to 1904, which should serve to eliminate
those pesky Antarctica zones, and also added a tie-breaking rule for
identical zones: prefer shorter names, or alphabetically earlier names
when they are the same length.  We'll see how people like that ...

            regards, tom lane