Millisecond clock resolution for DateAndTime now

David T. Lewis lewis at mail.msen.com
Sun Sep 26 20:45:40 UTC 2004


On Sun, Sep 26, 2004 at 12:30:59PM -0700, Tim Rowledge wrote:
> lex at cc.gatech.edu wrote:
> 
> > And while we're at it, how about adjusting the primitive's *interface*
> > to ask for the UTC offset as well?  The get-time primitive would then
> > return two things:
> > 
> > 	1. The time, probably as approximately[1] the number of seconds since
> > some epoch.
> > 	
> > 	2. The offset in seconds to get to UTC time.
> a) we can add a new primitive easily enough. Changing an old one is
> dangerous
> b) Why return munged up seconds when quite often the image code
> immediately works backwards to derive the day/hour/year etc? Let's pass
> the prim a sensible date/time object aand fill in the
> year/day/hour/minute/second/mSec/flavour-of-the-day-icecream etc. No
> need to worry about epoch stuff. Leave the OS to care about timezone,
> DST.

That's exactly what Lex is suggesting. A primitive that simultaneously
answers the unmunged-up time along with the OS-provided mungifier
that the image can use to adjust for local time zone and DST offset
when displaying time and date values. Yes of course the primitive should
have a different name.

Dave




More information about the Squeak-dev mailing list