[Seaside] Re: Time Zone Point of Curiosity
architect at chronos-st.org
Sat Dec 16 10:02:16 UTC 2006
Michael Rueger <m.rueger <at> acm.org> writes:
> Alan Lovejoy wrote:
> > Thomas Koschate <koschate <at> gmail.com> writes:
> >> Whenever I load up an image from scratch, the Seaside installation
> >> process seems to have an almost pathological desire to adjust my
> >> image's time zone to Central European Time. Why CET? Why not GMT, or
> >> EST, or PST, or maybe even just assuming that I've already set the
> >> time zone that I want?
> > In a sense, Squeak does this as well, since its system clock runs in local
> > time, based on whatever local time the host OS claims is correct. But
> > has no idea what the current offset from Universal Time happens to be. So,
> Well, we have a locale plugin for a while now, which allows you to query
> for the local time zone. At least that's what the API suggests, not sure
> it is implemented on all platforms yet.
Well, that's better than nothing--although "experimental" code (that's not well
known, isn't installed by default, and may not work on all platforms) just
doesn't make the grade.
Also, the API is underpowered. It only promises to provide a boolean flag that
indicates whether or not DST is currently in effect, and to provide the current
local time offset from UT (in minutes.) Although that's better than nothing,
what's needed for minimally-acceptable functionality is a function that
provides the local timezone's offset from UT for any point in time (where the
point-in-time is an input of the function.) Anything less than that makes it
impossible to correctly do date/time arithmetic, or to correctly translate
timestamps to or from other timezones. One reason this is so is because not
all timezones change their offset by a full hour for DST. Another reason is
because adding or subtracting even a fraction of a second to or from a point
int local time might cross a DST transition.
More information about the Seaside