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

Eliot Miranda eliot.miranda at gmail.com
Fri May 18 23:55:39 UTC 2012


On Fri, May 18, 2012 at 4:47 PM, David T. Lewis <lewis at mail.msen.com> wrote:

> On Fri, May 18, 2012 at 09:30:32PM +0200, Bert Freudenberg wrote:
> > On 18.05.2012, at 19:22, Eliot Miranda wrote:
> >
> > > 'From Smalltalk-80, version 2, of April 1, 1983 on 31 May 1983 at
> 9:10:35 am'!
> >
> > That's obviously an April Fool's joke ;)
> >
> >
> > But very interesting indeed. I had assumed that the way Squeak handles
> > time is identical to how Smalltalk-80 did it. Apparently not, they must
> > have simplified in the Mac version.
> >
> > - Bert -
> >
>
> The original Squeak implementation of Time class>>totalSeconds uses
> primSecondsClock, which is documented as:
>
> primSecondsClock
>        "Answer the number of seconds since 00:00 on the morning of
>         January 1, 1901 (a 32-bit unsigned number).
>         Essential. See Object documentation whatIsAPrimitive. "
>
> This does not specify whether it refers to the local time zone or to GMT,
> and the actual implementation in Squeak has always used local time.
>
> The Blue Book documents Time class>totalSeconds as "Answer the total
> seconds
> from Jan. 1, 1901, corrected for time zone and daylight savings time."
>
> And Time class>>timeWords is "Answer the seconds (in Greenwich Mean Time)
> since Jan. 1, 1901 ..."
>
> So it certainly does sound like totalSeconds was intended to be seconds
> since Jan. 1, 1901 GMT, and it also appears that totalSeconds has been
> implemented differently in Squeak.
>
> After seeing Eliot's code reference, I'm inclined to think that the Blue
> Book provided an unambiguous definition (though poorly worded), and that
> Squeak has apparently been implementing it differently all along. There
> is nothing in the Squeak image itself that gives a clue as to the original
> intent (Time class>>timeWords is not present in Squeak), so the conflicting
> implementations are now in wide circulation.
>
> None of this does much to convince me that refering to a clearly defined
> Posix epoch would be a bad idea ...
>

Bit it's so dull ;)  The start of the 20th century, albeit the traditional
01 start instead of the colloquial 00 start, is so much nicer.  I strongly
suspect that 1970 was chosen more because of the absence of large integer
arithmetic in libc (31 bit seconds run aground in 2038), and so is mere
pragmatism.  Some of us were already born in 1970, and I hate being
negative.


> Dave
>
>
>


-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20120518/48156ffc/attachment.htm


More information about the Squeak-dev mailing list