local time (was: something about Celeste)

Lex Spoon lex at cc.gatech.edu
Mon Dec 6 10:52:39 UTC 1999


Stan Heckman <stan at stanheckman.com> wrote:
> "Lex Spoon" <lex at cc.gatech.edu> writes:
> > I don't suppose there is a time zone that ignores leap seconds?  So that
> > it would actually be 86400 times the number of days, plus the number of
> > elapsed seconds today?
> 
> There are several time systems without leap seconds. Best known is
> International Atomic Time, abbreviated TAI. UTC is based on TAI; the
> only difference between the two is an integer number of seconds,
> adjusted as necessary by addition or removal of a leap
> second. Unfortunately, TAI wouldn't simplify our method comments; most
> users have never heard of it, so if we referred to it, we would then
> need to explain what TAI is, and how it is related to UTC.
> 
> A brief summary of time systems is available at
> http://www.faqs.org/faqs/astronomy/faq/part3/section-5.html
> 

Okay, I thought about this over the weekend.  How about just skipping
the whole "seconds since the epoch" thing and saying:

	this method returns local/utc time, encoded as (day*86400 + hours*3600
+ minutes*60 + seconds)


Converting to/from TAI might be a first step for a more general purpose
timezone library--since the only difference is in leap seconds, this
problem should be relatively simple.  If you don't care about an
occasional missing second, then you can even just treat the UTC value as
a TAI value.  Of course, arithmetic on local times is impossible, but
you can do a lot with just this (namely, Celeste headers, smarter
timestamps, and, I think, HTTP caches with expiry.  Plus ClockMorph's
will look right under Unix for the first time :)).



Lex





More information about the Squeak-dev mailing list