[ENH] DateAndTime
Lex Spoon
lex at cc.gatech.edu
Mon Apr 29 17:32:52 UTC 2002
Ross Boylan <RossBoylan at stanfordalumni.org> wrote:
> On Mon, Apr 29, 2002 at 12:08:07AM -0400, Lex Spoon wrote:
> > "Ross Boylan" <RossBoylan at stanfordalumni.org> wrote:
> > >
> > Are you aware of the existing implementation of ANSI classes and methods
> > by Richard Harmon?
> >
> > http://minnow.cc.gatech.edu/squeak/2384
> >
> >
> > ANSI Squeak is here. Nobody seems to know about it.
> >
> > -Lex
>
> That may have been the other implementation I was thinking of. I have
> not had much of a chance to compare them.
>
> I do recall there was some implementation that said it was a bit of an
> experiment or an exercise. The classes I provided are pretty well
> worked through (not by me, but by Brent).
>
> One problem I noticed is that the classes don't track changes to and
> from daylight savings time. This might be less of an issue on systems
> where the clock is set to UTC, but I find I need to reset the offset
> from UTC manually. Even if the clock is on UTC, presumably this would
> need to be reset to get the correct local wall-clock time. I'm not
> sure if this is specific to the DateAndTime classes in the enhancement
> I posted, or if other implementations (e.g., the classes in the base
> image) have similar problems.
Actually, if you additionally use my plugin for local time, then you get
ANSI *and* proper local times, which track daylight savings equally as
well as the underlying OS. I haven't gotten rebuilt the plugin in a while,
but it shouldn't be hard if all the changesets can be located.... (No, I really
don't know off the top of my head!)
> I was told that the ANSI date/time stuff wasn't likely to go in the
> baseline image because it would be too disruptive. However, that
> might be less of an issue with classes that supplement, rather than
> replace, the existing Date and Time classes.
It seems the ANSI stuff *hasn't* gone in because it *might* be
disruptive. I've always expected, however, that they would go in
eventually. Who knows?
By the way, DateAndTime (or Chris's Timestamp) is a useful class to have
around. This isn't just about makeing Squeak standard -- ANSI has made
improvements. Notice, for example, that local time and UTC time might
have different dates; the fact that date and time are combined makes
this easy to deal with. Existing Squeak code passes around 2-element
arrays when this need arises.
Lex
More information about the Squeak-dev
mailing list
|