[squeak-dev] Re: [Pharo-project] Epoch returns local offset

David T. Lewis lewis at mail.msen.com
Fri May 18 18:47:09 UTC 2012


On Fri, May 18, 2012 at 10:22:12AM -0700, Eliot Miranda wrote:
> On Thu, May 17, 2012 at 5:59 PM, David T. Lewis <lewis at mail.msen.com> wrote:
> 
> > On Thu, May 17, 2012 at 04:01:11PM -0700, Eliot Miranda wrote:
> > > On Thu, May 17, 2012 at 10:42 AM, Bert Freudenberg <bert at freudenbergs.de
> > >wrote:
> > >
> > > > On 17.05.2012, at 19:29, Eliot Miranda wrote:
> > > >
> > > > What is ambiguous about the start of the 20-th century in GMT?
> > > >
> > > >
> > > > Nothing. But Smalltalk epoch was not defined in GMT. It's local time.
> > > >
> > >
> > > I'm not sure I buy that.   Looking at Smalltalk-80 v2 the California
> > > timezone was hardwired in.  So I think the epoch was in GMT and e.g. Time
> > > currentSeconds: #seconds answered the number of seconds from the GMT
> > epoch.
> >
> > If that were actually true, someone would have said so when they described
> > the meaning of the Smalltalk epoch. But they did not say so, and no such
> > definition exists anywhere except in the unsubstantiated opinions and
> > misconceptions of you, me, and everyone else on this list.
> >
> 
> It exists in the Smalltalk-80 sources Time class>>currentTime: method (find
> attached; apologies for calling it currentSeconds: in my previous post):
> 
> 'From Smalltalk-80, version 2, of April 1, 1983 on 31 May 1983 at 9:10:35
> am'!
> 
> !Time class methodsFor: 'private'!
> currentTime: formatted
> "If formatted is #seconds, answer with the total seconds from Jan 1 1901
> corrected for time zone and daylight savings time.
> Otherwise, answer an array of (Date today, Time now).
> m570 and m571 are time zone specific parameters, set for California."
> 

<snip>

> This seems pretty clear to me.  The epoch is the start of the 20th century
> in GMT, and the currentTime answers the time in PST relative to the epoch
> in GMT.  There's nothing opinionated or unsubstantiated about this code.
> 

You're quite right about that, and thanks for providing the code reference.

I stand corrected - there is also an explicit reference to GMT on page 112
of the blue book (Time class>>timeWords).

I'll have to dig out an older Squeak image when I get home. I don't recall
that it ever worked this way, but I could be mistaken.

I do stand by my recommendation of the Posix epoch for use as a clearly
defined and well documented time basis.

Dave



More information about the Squeak-dev mailing list