Discussion:
How do I set Time Zone (OS X)
(too old to reply)
Eric Lindsay
2004-11-28 06:53:29 UTC
Permalink
While travelling I pass through some time zone that are not covered by
the list of cities in the System Preferences. In some cases these are
local time zones in remote areas, so there is no appropriate large city
nearby in any case.

Does anyone know how I can get additional cities into the Time Zone
settings? Some plist somewhere maybe?

In Terminal, I can find time zone information for cities that do not
appear in the GUI. For example, under Australia, there is a file for
Broken_Hill, which although nominally uses the NSW (Sydney) time zone,
actually needs most of the time zone information a different state
(Adelaide in SA). There is a zone information compiler included, and so
you can make up your own time zone files (I specifically want one for
the unofficial Mid West Australian time zone, covering Eucla and Border
Crossing) however I can't see how to tell the GUI to use any such file I
might generate.

Does anyone have any idea how to solve this?
--
http://www.ericlindsay.com
Jeremy Nixon
2004-11-28 08:28:50 UTC
Permalink
Post by Eric Lindsay
Does anyone know how I can get additional cities into the Time Zone
settings? Some plist somewhere maybe?
Unfortunately, the GUI seems to have a fixed list of available time zones,
rather than using the system's idea of what zones exist. In fact, there
are some handy files that exist in the Olsen time zone distribution, which
is what everyone uses, that do exist on FreeBSD but have been omitted by
Apple in OS X for some obscure reason -- files I've used myself to make
a GUI for time zone selection based on the existing list of zones (not on
OS X). But in any case, no, the Preferences GUI does not take into account
what time zones actually exist on the system, and I know of no way to add
zones to the GUI.

However, I don't *think* the GUI is any more than a front-end to set the TZ
environment variable. So, if you have a time zone file on the system that
the GUI doesn't know about, you should be able to use it fully by setting
TZ in your environment manually.

You can set environment variables for the full GUI session in the
~/.MacOSX/environment.plist file, which is a file in plist format. If it
doesn't exist, create it to look roughly like this:

<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>TZ</key>
<string>My_Wacky_Timezone</string>
</dict>
</plist>

Obviously, replace My_Wacky_Timezone with the time zone you want to use,
which is the name of the zoneinfo file including the subdirectory it's in,
for example "America/New_York". If the environment.plist file already
exists, just add the <key> and <string> pair to it.

You'll need to log out and back in to make the change take effect.

Then, I guess, don't open the time zone preferences, because it's likely
to mess things back up again.
--
Jeremy | ***@exit109.com
Ron Parsons
2004-11-28 11:07:58 UTC
Permalink
Post by Jeremy Nixon
Post by Eric Lindsay
Does anyone know how I can get additional cities into the Time Zone
settings? Some plist somewhere maybe?
Unfortunately, the GUI seems to have a fixed list of available time zones,
rather than using the system's idea of what zones exist. In fact, there
are some handy files that exist in the Olsen time zone distribution, which
is what everyone uses, that do exist on FreeBSD but have been omitted by
Apple in OS X for some obscure reason -- files I've used myself to make
a GUI for time zone selection based on the existing list of zones (not on
OS X). But in any case, no, the Preferences GUI does not take into account
what time zones actually exist on the system, and I know of no way to add
zones to the GUI.
However, I don't *think* the GUI is any more than a front-end to set the TZ
environment variable. So, if you have a time zone file on the system that
the GUI doesn't know about, you should be able to use it fully by setting
TZ in your environment manually.
You can set environment variables for the full GUI session in the
~/.MacOSX/environment.plist file, which is a file in plist format. If it
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>TZ</key>
<string>My_Wacky_Timezone</string>
</dict>
</plist>
Obviously, replace My_Wacky_Timezone with the time zone you want to use,
which is the name of the zoneinfo file including the subdirectory it's in,
for example "America/New_York". If the environment.plist file already
exists, just add the <key> and <string> pair to it.
You'll need to log out and back in to make the change take effect.
Then, I guess, don't open the time zone preferences, because it's likely
to mess things back up again.
With that last sentence being a key, the old Map Control Panel still
exists under Applications (Mac OS 9):Apple Extras:Map Control Panel.
--
Ron Parsons
Eric Lindsay
2004-11-29 03:01:12 UTC
Permalink
Post by Jeremy Nixon
You can set environment variables for the full GUI session in the
~/.MacOSX/environment.plist file, which is a file in plist format.
Many thanks for explaining that, and pointing me at the plist (it didn't
exist previously). There certainly seems a lot to learn about OS X.
I'll do some experimenting with it before my next travel to a weird time
zone.

Another poster mentioned OS 9. I did previously find the Mac OS 9 map,
but decided that as I've never used Mac OS 9 and don't (knowingly) have
any Classic applications, that I wouldn't get involved with any tricks
that predated OS X.

Thanks.
--
http://www.ericlindsay.com
Tom Harrington
2004-11-29 06:09:32 UTC
Permalink
In article
Post by Eric Lindsay
Post by Jeremy Nixon
You can set environment variables for the full GUI session in the
~/.MacOSX/environment.plist file, which is a file in plist format.
Many thanks for explaining that, and pointing me at the plist (it didn't
exist previously). There certainly seems a lot to learn about OS X.
I'll do some experimenting with it before my next travel to a weird time
zone.
Just out of curiosity, could you give an example of a time zone where
this is a problem? A couple of jobs ago I was responsible for writing
the time-zone handling code for an operating system, and I'm surprised
Apple wouldn't have found a way to make them all available somehow.
--
Tom "Tom" Harrington
Macaroni, Automated System Maintenance for Mac OS X.
Version 2.0: Delocalize, Repair Permissions, lots more.
See http://www.atomicbird.com/
Roger Johnstone
2004-11-29 09:28:27 UTC
Permalink
Post by Tom Harrington
In article
Post by Eric Lindsay
Post by Jeremy Nixon
You can set environment variables for the full GUI session in the
~/.MacOSX/environment.plist file, which is a file in plist format.
Many thanks for explaining that, and pointing me at the plist (it
didn't exist previously). There certainly seems a lot to learn
about OS X. I'll do some experimenting with it before my next
travel to a weird time zone.
Just out of curiosity, could you give an example of a time zone where
this is a problem? A couple of jobs ago I was responsible for writing
the time-zone handling code for an operating system, and I'm surprised
Apple wouldn't have found a way to make them all available somehow.
I suppose adding "Other..." and letting the user type in whatever time
zone offset they wanted would be too simple.

Pet peeve: software which only lets you set the time zone to +/- 12
hours from UTC. During summer New Zealand uses UTC+13 hours!
--
Roger Johnstone, Invercargill, New Zealand
http://vintageware.orcon.net.nz/
________________________________________________________________________
No Silicon Heaven? Preposterous! Where would all the calculators go?

Kryten, from the Red Dwarf episode "The Last Day"
Tom Harrington
2004-11-29 16:42:15 UTC
Permalink
Post by Roger Johnstone
Post by Tom Harrington
In article
Post by Eric Lindsay
Post by Jeremy Nixon
You can set environment variables for the full GUI session in the
~/.MacOSX/environment.plist file, which is a file in plist format.
Many thanks for explaining that, and pointing me at the plist (it
didn't exist previously). There certainly seems a lot to learn
about OS X. I'll do some experimenting with it before my next
travel to a weird time zone.
Just out of curiosity, could you give an example of a time zone where
this is a problem? A couple of jobs ago I was responsible for writing
the time-zone handling code for an operating system, and I'm surprised
Apple wouldn't have found a way to make them all available somehow.
I suppose adding "Other..." and letting the user type in whatever time
zone offset they wanted would be too simple.
It would be, if for no other reason than that the zone offset varies
depending on summer time vs. winter time. Setting clocks ahead and
behind at different times of year is pretty common, and users generally
expect their computers to handle this automatically. Entering an offset
would in many places require the user to reset the offset twice a year.

If it were me I'd try to come up with a user-friendly wrapper around the
tzselect(8) command, which is designed to help people find the right
time zone for their computer. It doesn't seem that Apple has included
this on Mac OS X, but it's available as open-source code should they
change their mind.
--
Tom "Tom" Harrington
Macaroni, Automated System Maintenance for Mac OS X.
Version 2.0: Delocalize, Repair Permissions, lots more.
See http://www.atomicbird.com/
Tom Harrington
2004-11-29 22:24:41 UTC
Permalink
Post by Tom Harrington
If it were me I'd try to come up with a user-friendly wrapper around the
tzselect(8) command, which is designed to help people find the right
time zone for their computer. It doesn't seem that Apple has included
this on Mac OS X, but it's available as open-source code should they
change their mind.
I was looking at what it would take to enhance this ('cause I'm a geek
with previous experience in getting time-zone info to work on computers,
that's why), it wouldn't be too hard to improve the Date & Time control
panel's time-zone handling without writing any new software.

The underlying timezone code that Mac OS X uses supports 385 different
time zones, but System Preferences only allows you to select 203 of
them. The additional 182 zones could be added in such a way that the
extra zones would just show up in System Preferences as though they'd
always been there. This information could be wrapped up into an
installable package that would enhance "Date & Time".

I'd even give the result away for free, if I could get some help in
collecting the necessary information from interested people. It's not
complex to do, it's just that it's a lot of data to collect. I'd need
info about each of the missing 182 zones in order to add them. For each
zone, I'd have the name of a city, and I'd need the name of the country
where it's located, as well as its latitude and longitude. Also, for
the map, which of the vertical bands the city would appear in (as in,
when you click on a location in the map, there's a vertical slice of the
map that highlights, and I'd need to know which one it would be).

Any volunteers? I'll post a list of zones that could be added if
there's interest.
--
Tom "Tom" Harrington
Macaroni, Automated System Maintenance for Mac OS X.
Version 2.0: Delocalize, Repair Permissions, lots more.
See http://www.atomicbird.com/
Eric Lindsay
2004-11-30 07:45:32 UTC
Permalink
Post by Tom Harrington
I'd even give the result away for free, if I could get some help in
collecting the necessary information from interested people. It's not
complex to do, it's just that it's a lot of data to collect. I'd need
info about each of the missing 182 zones in order to add them. For each
zone, I'd have the name of a city, and I'd need the name of the country
where it's located, as well as its latitude and longitude. Also, for
the map, which of the vertical bands the city would appear in (as in,
when you click on a location in the map, there's a vertical slice of the
map that highlights, and I'd need to know which one it would be).
Any volunteers? I'll post a list of zones that could be added if
there's interest.
I'll try to get you all the missing ones for Australia. I guess I just
need to check which the GUI covers, and which zones can be found
manually only (I think only Broken Hill and Lord Howe island). Plus of
course the unofficial Central West zone that got me started on this.

I was really annoyed that on my 1997 Psion PDA I could make the needed
adjustment in a few seconds (OK, I did have to look up the lat and long,
but I had a GPS with me).
--
http://www.ericlindsay.com
Tom Harrington
2004-11-30 16:41:06 UTC
Permalink
In article
Post by Eric Lindsay
Post by Tom Harrington
I'd even give the result away for free, if I could get some help in
collecting the necessary information from interested people. It's not
complex to do, it's just that it's a lot of data to collect. I'd need
info about each of the missing 182 zones in order to add them. For each
zone, I'd have the name of a city, and I'd need the name of the country
where it's located, as well as its latitude and longitude. Also, for
the map, which of the vertical bands the city would appear in (as in,
when you click on a location in the map, there's a vertical slice of the
map that highlights, and I'd need to know which one it would be).
Any volunteers? I'll post a list of zones that could be added if
there's interest.
I'll try to get you all the missing ones for Australia. I guess I just
need to check which the GUI covers, and which zones can be found
manually only (I think only Broken Hill and Lord Howe island). Plus of
course the unofficial Central West zone that got me started on this.
The BSD-level time-zone support includes these Australian zones that
aren't covered by the GUI:

Australia/Broken_Hill
Australia/Lindeman
Australia/Lord_Howe

It would be possible to make System Prefs recognize these by adding the
information described above.

If I'm going to do this, though, I'd prefer to cover more of the missing
zones, and make it a more-complete solution. If I were going to give
the result away I'd want some more help from others in collecting the
data.

If anyone else would be willing to pitch in, please let me know, either
here or through email. The full list of missing-in-System-Prefs zones
is as follows:

Africa/Abidjan
Africa/Banjul
Africa/Bissau
Africa/Blantyre
Africa/Brazzaville
Africa/Bujumbura
Africa/Ceuta
Africa/El_Aaiun
Africa/Gaborone
Africa/Kigali
Africa/Libreville
Africa/Lome
Africa/Lubumbashi
Africa/Malabo
Africa/Maseru
Africa/Mbabane
Africa/Niamey
Africa/Porto-Novo
Africa/Sao_Tome
Africa/Timbuktu
Africa/Windhoek
America/Anguilla
America/Antigua
America/Araguaina
America/Argentina/Buenos_Aires
America/Argentina/Catamarca
America/Argentina/ComodRivadavia
America/Argentina/Cordoba
America/Argentina/Jujuy
America/Argentina/La_Rioja
America/Argentina/Mendoza
America/Argentina/Rio_Gallegos
America/Argentina/San_Juan
America/Argentina/Tucuman
America/Argentina/Ushuaia
America/Aruba
America/Bahia
America/Barbados
America/Belem
America/Belize
America/Boa_Vista
America/Boise
America/Cambridge_Bay
America/Campo_Grande
America/Cancun
America/Cayman
America/Chihuahua
America/Cuiaba
America/Curacao
America/Danmarkshavn
America/Dawson
America/Dawson_Creek
America/Dominica
America/Edmonton
America/Eirunepe
America/Fortaleza
America/Glace_Bay
America/Goose_Bay
America/Grand_Turk
America/Grenada
America/Guadeloupe
America/Halifax
America/Hermosillo
America/Indiana/Knox
America/Indiana/Marengo
America/Indiana/Vevay
America/Inuvik
America/Iqaluit
America/Jamaica
America/Juneau
America/Kentucky/Monticello
America/Louisville
America/Maceio
America/Manaus
America/Martinique
America/Mazatlan
America/Menominee
America/Merida
America/Miquelon
America/Monterrey
America/Montserrat
America/Nassau
America/Nipigon
America/Nome
America/Noronha
America/North_Dakota/Center
America/Pangnirtung
America/Port_of_Spain
America/Porto_Velho
America/Rainy_River
America/Rankin_Inlet
America/Regina
America/Rio_Branco
America/Scoresbysund
America/Shiprock
America/St_Johns
America/St_Kitts
America/St_Lucia
America/St_Thomas
America/St_Vincent
America/Swift_Current
America/Thule
America/Thunder_Bay
America/Tijuana
America/Toronto
America/Tortola
America/Whitehorse
America/Yakutat
America/Yellowknife
Antarctica/Casey
Antarctica/Davis
Antarctica/DumontDUrville
Antarctica/Mawson
Antarctica/McMurdo
Antarctica/Palmer
Antarctica/Rothera
Antarctica/South_Pole
Antarctica/Syowa
Antarctica/Vostok
Arctic/Longyearbyen
Asia/Almaty
Asia/Aqtau
Asia/Aqtobe
Asia/Ashgabat
Asia/Baku
Asia/Bishkek
Asia/Brunei
Asia/Choibalsan
Asia/Chongqing
Asia/Dhaka
Asia/Dili
Asia/Dushanbe
Asia/Gaza
Asia/Harbin
Asia/Hovd
Asia/Irkutsk
Asia/Jayapura
Asia/Kamchatka
Asia/Kashgar
Asia/Kuching
Asia/Macau
Asia/Makassar
Asia/Nicosia
Asia/Oral
Asia/Pontianak
Asia/Qyzylorda
Asia/Sakhalin
Asia/Samarkand
Asia/Tbilisi
Asia/Thimphu
Asia/Urumqi
Asia/Vientiane
Asia/Yerevan
Atlantic/Bermuda
Atlantic/Canary
Atlantic/Cape_Verde
Atlantic/Faeroe
Atlantic/Jan_Mayen
Atlantic/Madeira
Atlantic/St_Helena
Atlantic/Stanley
Australia/Broken_Hill
Australia/Lindeman
Australia/Lord_Howe
Europe/Andorra
Europe/Belfast
Europe/Bratislava
Europe/Chisinau
Europe/Gibraltar
Europe/Kaliningrad
Europe/Luxembourg
Europe/Malta
Europe/Mariehamn
Europe/Minsk
Europe/Monaco
Europe/Riga
Europe/Samara
Europe/San_Marino
Europe/Sarajevo
Europe/Simferopol
Europe/Skopje
Europe/Tallinn
Europe/Tirane
Europe/Uzhgorod
Europe/Vaduz
Europe/Vatican
Europe/Vilnius
Europe/Zaporozhye
Indian/Chagos
Indian/Christmas
Indian/Cocos
Indian/Comoro
Indian/Kerguelen
Indian/Mayotte
Indian/Reunion
Pacific/Apia
Pacific/Chatham
Pacific/Easter
Pacific/Efate
Pacific/Enderbury
Pacific/Fakaofo
Pacific/Fiji
Pacific/Funafuti
Pacific/Galapagos
Pacific/Gambier
Pacific/Guadalcanal
Pacific/Johnston
Pacific/Kiritimati
Pacific/Kosrae
Pacific/Kwajalein
Pacific/Majuro
Pacific/Marquesas
Pacific/Midway
Pacific/Nauru
Pacific/Niue
Pacific/Norfolk
Pacific/Noumea
Pacific/Palau
Pacific/Pitcairn
Pacific/Ponape
Pacific/Port_Moresby
Pacific/Rarotonga
Pacific/Saipan
Pacific/Tahiti
Pacific/Tarawa
Pacific/Tongatapu
Pacific/Truk
Pacific/Wake
Pacific/Wallis
Pacific/Yap
--
Tom "Tom" Harrington
Macaroni, Automated System Maintenance for Mac OS X.
Version 2.0: Delocalize, Repair Permissions, lots more.
See http://www.atomicbird.com/
Obfus Kataa
2004-11-30 22:38:32 UTC
Permalink
Does the timezone info come from
/System/Library/PreferencePanes/DateAndTime.prefPane/Contents/Resources/TimeZone.prefPane/Contents/Resources/all_cities_adj.plist

I edited that file to add information for America/Louisville some time ago
and to add my own nearby city. I get those in my list of cities in the
preferences and the crosshairs appear to be in the correct place on the map.
The header says to look for the Timezone file in /usr/share/zoneinfo and to
reference the name stored in field four of each entry.

Maybe this doesn't work for entries that fall between zones, perhaps I only
have it because I upgraded along the way (10.1.5 to 10.3.6)
--
oK+++
DOWN WITH BUS^H^H^HASH^H^H^HBIG BROTHER
17:27 up 7 days, 6:38, 1 user, load averages: 0.16 0.18 0.13
Tom Harrington
2004-11-30 22:59:14 UTC
Permalink
Post by Obfus Kataa
Does the timezone info come from
/System/Library/PreferencePanes/DateAndTime.prefPane/Contents/Resources/TimeZo
ne.prefPane/Contents/Resources/all_cities_adj.plist
Yes...
Post by Obfus Kataa
I edited that file to add information for America/Louisville some time ago
and to add my own nearby city. I get those in my list of cities in the
preferences and the crosshairs appear to be in the correct place on the map.
The header says to look for the Timezone file in /usr/share/zoneinfo and to
reference the name stored in field four of each entry.
Right...
Post by Obfus Kataa
Maybe this doesn't work for entries that fall between zones, perhaps I only
have it because I upgraded along the way (10.1.5 to 10.3.6)
Are you actually having some kind of problem? I guess I'm not sure what
you're getting at here.
--
Tom "Tom" Harrington
Macaroni, Automated System Maintenance for Mac OS X.
Version 2.0: Delocalize, Repair Permissions, lots more.
See http://www.atomicbird.com/
Obfus Kataa
2004-11-30 23:31:41 UTC
Permalink
Post by Tom Harrington
Post by Obfus Kataa
Does the timezone info come from
/System/Library/PreferencePanes/DateAndTime.prefPane/Contents/Resources/TimeZo
ne.prefPane/Contents/Resources/all_cities_adj.plist
Yes...
Post by Obfus Kataa
I edited that file to add information for America/Louisville some time ago
and to add my own nearby city. I get those in my list of cities in the
preferences and the crosshairs appear to be in the correct place on the map.
The header says to look for the Timezone file in /usr/share/zoneinfo and to
reference the name stored in field four of each entry.
Right...
Post by Obfus Kataa
Maybe this doesn't work for entries that fall between zones, perhaps I only
have it because I upgraded along the way (10.1.5 to 10.3.6)
Are you actually having some kind of problem? I guess I'm not sure what
you're getting at here.
No, it is possible that I missed some replies in the thread. I thought the
OP was looking for some way to add his TimeZone, and that he wasn't that
concerned about the method. The drift of the posts I saw was that there was
no ready way, but this seems pretty simple if you are used to editing
configuration files by hand, which I assumed someone who'd written a manual
for a homebrew 68000 computer might be.
--
oK+++
Mistakes live in the neighbourhood of truth and therefore delude us.
-Rabindranath Tagore
18:27 up 7 days, 7:39, 1 user, load averages: 0.02 0.07 0.07
Eric Lindsay
2004-12-01 04:59:22 UTC
Permalink
Post by Obfus Kataa
No, it is possible that I missed some replies in the thread. I thought the
OP was looking for some way to add his TimeZone, and that he wasn't that
concerned about the method. The drift of the posts I saw was that there was
no ready way, but this seems pretty simple if you are used to editing
configuration files by hand, which I assumed someone who'd written a manual
for a homebrew 68000 computer might be.
There have been a number of highly interesting posts in this thread. As
a switcher, I certainly don't know as much about the Mac as I'd like, so
names and locations of specific files have been really handy.

While it is true that I'm not particularly concerned at the prospect of
changing configuration files with vi or whatever, I am given to
understand that this isn't the case for all Mac users. I can't imagine
that I am the only user who at times would find a non-supported time
zone handy. Also, I thought a need for change would most often happen
while travelling.

In the original case I mentioned, we were driving around Australia and
had been on the road for a couple of months, so I didn't have any
reference material with me. We spent either one or two nights in the
weird time zone, in accommodation that didn't run to a phone or internet
connection (no lines in the room, out of cell range). Under those
circumstances, a GUI interface to all the possible time zones would have
been nice. Not essential, but more in keeping with what I am coming to
see as the Mac way of doing things. I noted it as something to chase up
when I got home.
--
http://www.ericlindsay.com
Eric Lindsay
2004-12-01 05:22:08 UTC
Permalink
Post by Obfus Kataa
Does the timezone info come from
/System/Library/PreferencePanes/DateAndTime.prefPane/Contents/Resources/TimeZo
ne.prefPane/Contents/Resources/all_cities_adj.plist
I have the same file, and I've never had anything prior to OS X 10.3
Post by Obfus Kataa
I edited that file to add information for America/Louisville some time ago
and to add my own nearby city. I get those in my list of cities in the
preferences and the crosshairs appear to be in the correct place on the map.
The header says to look for the Timezone file in /usr/share/zoneinfo and to
reference the name stored in field four of each entry.
While travelling I had looked at the /usr/share/zoneinfo area, and noted
that not all cities listed there appeared in the GUI. I didn't find the
appropriate pref file mentioned above.

How did you generate your file to place here? Did you just make a copy
of an existing nearby city file, or did you generate a new one by using
the Zone Information Compiler (zic) ?
Post by Obfus Kataa
Maybe this doesn't work for entries that fall between zones, perhaps I only
have it because I upgraded along the way (10.1.5 to 10.3.6)
I've been assuming that for any "out of the way" town that you wanted to
add, you would also need to generate an appropriate file in the correct
country in /usr/share/zoneinfo using zic

Had I used Unix in the last decade this might not have seemed so obscure
to me.
--
http://www.ericlindsay.com
Obfus Kataa
2004-12-01 10:36:58 UTC
Permalink
Post by Eric Lindsay
Post by Obfus Kataa
Does the timezone info come from
/System/Library/PreferencePanes/DateAndTime.prefPane/Contents/Resources/TimeZo
ne.prefPane/Contents/Resources/all_cities_adj.plist
I have the same file, and I've never had anything prior to OS X 10.3
Post by Obfus Kataa
I edited that file to add information for America/Louisville some time ago
and to add my own nearby city. I get those in my list of cities in the
preferences and the crosshairs appear to be in the correct place on the map.
The header says to look for the Timezone file in /usr/share/zoneinfo and to
reference the name stored in field four of each entry.
While travelling I had looked at the /usr/share/zoneinfo area, and noted
that not all cities listed there appeared in the GUI. I didn't find the
appropriate pref file mentioned above.
How did you generate your file to place here? Did you just make a copy
of an existing nearby city file, or did you generate a new one by using
the Zone Information Compiler (zic) ?
I began by using a nearby city (Louisville, KY) which I copied from a
FreeBSD zoneinfo database I had. That was before I discovered the
prefrencepane file. I do not have a file in zoneinfo for the town in which
I live which is in the same timezone as is Louisville. But the crosshairs
in the timezone tab look to be correct for the lat/long I entered in the
prefpane config file, and the switch from daylight to standard occurs
correctly. I also have added to ~/.MacOSX/environment.plist the following:
<key>TZ</key>
<string>America/Louisville</string>

I should read the man page for zic more closely to see how to create a file
for my town. Is there a zic decompiler? Editing an existing file from a
nearby town would be much simpler than tracking down the history of timezone
changes to satisfy the fields zic appears to need.
--
oK+++
Obfus Kataa
2004-11-30 22:43:30 UTC
Permalink
I just found an article about adding a city to the Timezone for Jaguar.
This must be what I did on my system:
http://www.macosxhints.com/article.php?story=20020831074937191
--
oK+++
Jeremy Nixon
2004-12-01 19:29:44 UTC
Permalink
Post by Tom Harrington
I'd even give the result away for free, if I could get some help in
collecting the necessary information from interested people. It's not
complex to do, it's just that it's a lot of data to collect. I'd need
info about each of the missing 182 zones in order to add them. For each
zone, I'd have the name of a city, and I'd need the name of the country
where it's located, as well as its latitude and longitude.
Most of the data you want can be found on a FreeBSD system in the file
/usr/share/zoneinfo/zone.tab. If you don't have access to a system with
this file installed, let me know and I'll email it to you. It is basically
the "source" for the data in the prefpane resource file, and it has entries
for the "missing" zones.
Post by Tom Harrington
Also, for the map, which of the vertical bands the city would appear in
(as in, when you click on a location in the map, there's a vertical slice of the
map that highlights, and I'd need to know which one it would be).
I'm not entirely sure how to get *that* for everything, though.
--
Jeremy | ***@exit109.com
Tom Harrington
2004-12-01 19:53:16 UTC
Permalink
Post by Jeremy Nixon
Post by Tom Harrington
I'd even give the result away for free, if I could get some help in
collecting the necessary information from interested people. It's not
complex to do, it's just that it's a lot of data to collect. I'd need
info about each of the missing 182 zones in order to add them. For each
zone, I'd have the name of a city, and I'd need the name of the country
where it's located, as well as its latitude and longitude.
Most of the data you want can be found on a FreeBSD system in the file
/usr/share/zoneinfo/zone.tab. If you don't have access to a system with
this file installed, let me know and I'll email it to you. It is basically
the "source" for the data in the prefpane resource file, and it has entries
for the "missing" zones.
I've got it, but I hadn't looked closely enough to see that it had the
latitude/longitude info. Thanks for pointing that out, that makes the
project a lot easier.
Post by Jeremy Nixon
Post by Tom Harrington
Also, for the map, which of the vertical bands the city would
appear in (as in, when you click on a location in the map, there's
a vertical slice of the map that highlights, and I'd need to know
which one it would be).
I'm not entirely sure how to get *that* for everything, though.
In theory it should be a direct mapping from location coordinates to map
slice. But since Apple doesn't provide definitions of the map slices
(and since they're not simply vertical slices) it'll involve a little
guesswork. I would have thought Apple might just automatically
determine map slice from coordinates, but apparently that's not the case.
--
Tom "Tom" Harrington
Macaroni, Automated System Maintenance for Mac OS X.
Version 2.0: Delocalize, Repair Permissions, lots more.
See http://www.atomicbird.com/
Eric Lindsay
2004-12-03 06:24:19 UTC
Permalink
Post by Tom Harrington
In theory it should be a direct mapping from location coordinates to map
slice. But since Apple doesn't provide definitions of the map slices
(and since they're not simply vertical slices) it'll involve a little
guesswork. I would have thought Apple might just automatically
determine map slice from coordinates, but apparently that's not the case.
The locations vs map slices certainly aren't straight vertical slices,
but may perhaps be directly related to the difference from UTC. The
Australian East coast cities are mostly in the same map slice.

For example, Perth is in TimeZoneIndex 24 (8 hour offset), pretty much
by itself for Australia (2 hour difference from East Coast).
TimeZoneIndex 27 (10 hour offset) includes Sydney, Melbourne, Brisbane
(the later never uses Daylight Saving) Canberra, Hobart, however Darwin
and Adelaide are in TimeZoneindex 26 (a half hour difference with an
offset of 9:30). There is no 25 in Australia, since nothing in
Australia makes use of that 9 hour offset. However there will be in
countries to the north using a 9 hour offset.

Technically you would have 24 one hour time zones. However only
countries with a large east west spread occupy more than one. It occurs
to me that we may have 24 one hour time zones, plus 4 that are offset by
a half hour (one of which is in Australia).

I wonder if there is any easy way to get a list of countries with a GMT
offset that includes a half hour?

Moving to the zic compiler, it doesn't use lat and long, so any map
treatments obviously don't come from anything it produces. Seems to be
entirely related to GMT (sorry UTC) offset, and any rules for daylight
saving (month date time, etc). Partial example from the zic man page:
A zone line has the form
Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL]
For example:
Zone Australia/Adelaide 9:30 Aus CST 1971
Oct 31 2:00

I'd imagine all the map positions are coming from the
all_cities_adj.plist since that is where the latitude and longitude
information is. (Did everyone notice the UTC entry?)

That this file exists makes me wonder whether Apple intend to also use
it for additional time type information in the future. For example, my
Psion PDA has a highly similar file, for much the same purposes. This
is also used to generate local sunrise and sunset times (very handy for
a traveller). Since you can have one city as your home city and one as
your current city, it also generates the distance between the two
locations.
--
http://www.ericlindsay.com
Eric Lindsay
2004-12-03 05:50:56 UTC
Permalink
Post by Jeremy Nixon
/usr/share/zoneinfo/zone.tab
That is handy information. Not present on my Mac, but I'll get a copy
from some FreeBSD person. Thanks.
--
http://www.ericlindsay.com
Jeremy Nixon
2004-11-29 19:12:59 UTC
Permalink
Post by Roger Johnstone
I suppose adding "Other..." and letting the user type in whatever time
zone offset they wanted would be too simple.
The problem with time zone offsets is that they are ambiguous, and would
require manual updates. If you were to enter -0500, for example, that
could be US Eastern time, or it could be US Central time during the summer.
You really want to go by location rather than offset.

Adding "Other..." and letting the user enter the name of a zoneinfo file
that exists on the system but not in the GUI would be a pretty easy fix,
though. I actually tried that in the interface before posting my previous
reply, because I assumed it would work, but it didn't.
Post by Roger Johnstone
Pet peeve: software which only lets you set the time zone to +/- 12
hours from UTC. During summer New Zealand uses UTC+13 hours!
Most mistakes in time and date handling code are simply incorrect
assumptions about how things work. Most people don't realize how
complicated time and date measurement really is.
--
Jeremy | ***@exit109.com
Neill Massello
2004-11-30 01:38:11 UTC
Permalink
Post by Jeremy Nixon
Most mistakes in time and date handling code are simply incorrect
assumptions about how things work.
Which is why trying to make it too "simple" for the user is a mistake.
Summer (daylight saving) time could be handled with a dialog in Date and
Time similar to the customization dialogs in International: allow the
user to select a preset rule (United States, New Zealand, etc) or
specify a custom rule ("nth whatday of whatmonth at time xx") for the
time switch.
Post by Jeremy Nixon
Most people don't realize how complicated time and date measurement really
is.
Most people are smarter than most algorithms.
Eric Lindsay
2004-11-30 07:38:54 UTC
Permalink
Post by Tom Harrington
Just out of curiosity, could you give an example of a time zone where
this is a problem? A couple of jobs ago I was responsible for writing
the time-zone handling code for an operating system, and I'm surprised
Apple wouldn't have found a way to make them all available somehow.
Broken Hill (a mining town near the SA and NSW border in Australia)
should on the basis of its geography be in the NSW time zone (set as
Sydney time). However because the largest nearby city is in South
Australia, it uses SA time (with slight changes I believe in Daylight
Saving start or end dates to match NSW). There is no GUI setting that
copes with this, although the Apple does have a time zone file for
Broken Hill.

There are some very remote small towns near the border of WA and SA.
These are so distant from the capitol (Perth - it is a very wide state)
that Perth time is totally unsuitable. As a result Eucla and Border
Crossing run 45 minutes before Perth time (and 45 minutes after Adelaide
time, that being the nearest capitol). So it is a very non-standard
time zone, but matches the sun rather nicely.

I think the problem with Apple is that they haven't made access to the
GUI interface available for all the time zones that exist. As I
mentioned, there is a Zone Information Compiler available from Terminal,
and in the Australia section, Broken_Hill already exists.
--
http://www.ericlindsay.com
Continue reading on narkive:
Loading...