[BUG] Chronology DateAndTime class>>now returns incorrect time

Timothy Rowledge tim at sumeru.stanford.edu
Sat Feb 21 18:04:25 UTC 2004


On Feb 21, 2004, at 6:47 AM, Hans-Martin Mosner wrote:
> The problem is that DateAndTime class>>now incorrectly assumes that 
> the millisecondClockValue only counts from 0 to 999 within one step of 
> the totalSeconds.
> But the millisecondClockValue just counts up from the system startup, 
> and is not even synchronized to totalSeconds (so taking 
> millisecondClockValue\\1000 does not help).
Oh good grief. That was a really silly assumption on somebody's part.

If it is really considered important to have micro/nano second 
resolution in times we will want a new primitive that (for example) 
returns effectively the same as that unix call that gives the seconds 
and milliseconds etc. I'd doubt there are many OS calls that give 
reliable nanosecond results though While we're thinking about it, it 
might be useful to consider an optional prim that can make use of 
functions like gmtime() since that leaves the tricky arithmetic to 
someone else.

tim




More information about the Squeak-dev mailing list