[squeak-dev] Bug Fix and a Question concerning DateAndTime in
aldeveron at graffiti.net
Wed Jul 18 18:15:34 UTC 2012
> ----- Original Message -----
> From: JohnReed Maffeo
> Sent: 07/12/12 08:59 AM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: Re: [squeak-dev] Bug Fix and a Question concerning DateAndTime in Kernal-Chronology
> > ----- Original Message -----
> > From: Bert Freudenberg
> > Sent: 07/10/12 12:32 PM
> > To: The general-purpose Squeak developers list
> > Subject: Re: [squeak-dev] Bug Fix and a Question concerning DateAndTime in Kernal-Chronology
> >--- snip
> > asUTC and asLocal are actually defined in the ANSI Smalltalk standard:
> > asLocal
> > Answer a <DateAndTime> that represents the same UTC time as the receiver but in the local time specified by the implementation.
> > asUTC
> > Answer a <DateAndTime> that represents the same absolute time as the receiver but in the local time UTC. The exact meaning of UTC local time is specified by the implementation. The UTC local time must use the Gregorian calendar. <DateAndTimes> representing UTC times prior to the adoption of the Gregorian calendar must use the retrospective astronomical Gregorian calendar. It is an invariant that
> > <DateAndTime> asUTC offset = Duration zero.
> > If they currently do not do what they're supposed to do we should fix that.
> > (This also makes clear that using the Julian calendar for early dates is not allowed, so my proposed change is no good)
> > - Bert -
> My observation is that the current implementation does not conform to the ANSI Smalltalk standard as Bert presented it. I do not see any unit tests for toUTC and toLocal in TestRunner; I am starting to write them and see that there are some interesting challenges in developing the them. The first challenge that I am going to address is the fact a definitive, universal test cannot rely on the value of the local offset.
> I am planning to open an item in Mantis once I have a basic test complete.
When I opened a fresh 4.3 image to start writine tests, I discovered that the current implementation of asLocal and asUTC are working as expected. I now believe that somehow, the image that I was working in when I first reported a possible bug was corrupted somehow. It had been open on my computer for many days and I may have fat fingered something. I am still going to try and code up tests for asLocal and asUTC because I like the challenge.
More information about the Squeak-dev