[squeak-dev] Re: Date[And]Time fractional seconds printing

David T. Lewis lewis at mail.msen.com
Sun Aug 29 13:24:01 UTC 2010


On Sat, Aug 28, 2010 at 06:50:19PM -0700, Andreas Raab wrote:
> On 8/28/2010 1:18 PM, David T. Lewis wrote:
> >Hi Andreas,
> >
> >I just noticed something that looks odd in your original post on
> >this topic.  You referred to log files with time values like
> >"2010-08-18T23:17:49.888000007+00:00",
> >which is indeed silly nonsense. I am looking at a Squeak trunk
> >image on the traditional SqueakVM on Linux, and I never get values
> >like this for DateAndTime now. The nanos instance variable in
> >DateAndTime is coming from primitiveMillisecondClock which answers
> >an integer number of whole milliseconds, so I might get a DateAndTime
> >that looks like "2010-08-18T23:17:49.888+00:00". In other words,
> >the nanos might have a value like 888000000 but never 888000007.
> >
> >I can't account for those 7 nanoseconds in your example, but
> >they certainly should not be coming from the millisecond clock.
> 
> There is specific code that does it if you ask for the #now at the same 
> milliseconds:
> 
> (0 to: 9) collect:[:i| DateAndTime now].
> 
> You referred to http://bugs.squeak.org/view.php?id=474 and it states 
> explicitly:
> 
> "[the code] preserves the logic so that
> 
>     (DateAndTime now) <= (DateAndTime now) is always false.
> 
> "

D'oh! Of course.

Wow, you must be doing a *lot* of accesses to "DateAndTime now" in
order to get results like this. Something approaching a thousand per
second I should guess.

Dave




More information about the Squeak-dev mailing list