[Seaside] Re: Time Zone Point of Curiosity

Alan Lovejoy architect at chronos-st.org
Sun Dec 17 06:51:18 UTC 2006


David T. Lewis <lewis <at> mail.msen.com> writes:


> For Squeak, the TimeZoneDatabase (on SqueakMap) handles this. 

Your TimeZoneDatabase handles time zone offsets and transitions, and is a good 
solution, especially for applications running on BSD-Unix-based hosts, where 
one can expect to find a repository of binary tz files at pathnames that are 
easily derivable from the Olson time zone name, and where the /etc/localtime 
tzfile can be found that contains the offset transitions for the system's local 
time zone.

But for HP-UX, for some flavors of AIX, for some other non-BSD Unixes, and of 
course for any non-Unix machine, the situation is not so favorable.  Certainly, 
one can install a tzfile repository on any machine, and on Unix machines one 
may be able to put the localtime binary tzfile (or a symbolic link to one) in 
the /etc folder (if the system admin is friendly.)  But managing the logistics 
of all that (including the small detail of letting one's code know where the 
files can be found) becomes the responsibility of the Squeak application (or 
its developers/installers.)  The problem of choosing which Olson timezone 
should be contained in /etc/localtime (or its equivalent on a non-Unix box) 
remains.

Correct me if I'm wrong, but I believe that it's that problem--how to know 
which time zone rule set represents local time--that is the topic of this 
conversation.

After all, I already knew about your TimeZoneDatabase package when I posted 
above, just as you already knew about the Chronos Date/Time Library (of which I 
am the author,) which is also available for Squeak, and also solves all the 
same problems as does TimeZoneDatabase. I didn't mention either of them, for 
two reasons:  1) Both must be installed, and don't come "out of the box" with 
Squeak, and 2) the Squeak version of Chronos (unlike the VisualWorks and 
Dolphin versions) is not able to use the operating system to determine which 
Olson time zone represents local time, and the TimeZoneDatabase can only do so 
on some Unixes. 

And, now that I know of the Locale package, I would like to enhance the Squeak 
version of Chronos so that it will be able to determine the almost-certainly-
correct Olson timezone for local time on any platform for which the Locale 
package is implemented.

I also would like to leverage your TimeZoneDatabase code in Chronos, so that 
Chronos can read binary tzfiles, and especially so that it can read /etc/
localtime, if that file is available on the Unix box on which Chronos is being 
used.




More information about the Seaside mailing list