[GemStone-Smalltalk] DateAndTime users' questionnaire

Johan Brichau johan at yesplan.be
Tue Jun 23 08:49:59 PDT 2020

Hi Martin,

> (1) Which of the following messages do you use to create DateAndTime instances?
>  * DateAndTime now
>  * DateAndTime nowWithScale:
>  * DateAndTime fromString:
>  * DateAndTime year:day:hour* or year:month:day:hour*
>  * Other protocol

All of the above (except nowWithScale:) but, more importantly also the variants with an #offset: argument (i.e. timezone support).
Also: #date:time:

> (2) Do you need DateAndTimes with resolution finer than a microsecond?


> (3) What is your year range of DateAndTime; do you need or use DateAndTimes more than 5/10/50 years into the future (or the past)?

More than 10 years, less than 50 years (both in future and the past).
In practice, up to 20 years in the past and 10 years in the future (relative to today), but the date time instances of the year 2030, created today, will still have to be the same in 2040 (and beyond) as well.

> (4) How do you handle DateAndTime printing?

method extensions, printing date times in various locales and export formats

> (5) Have you created a subclass of DateAndTime or DateAndTimeANSI, or added your own methods to DateAndTime or DateAndTimeANSI?  If this is general functionality that could be useful to include in the base, please let us know.

No subclasses, but many extension methods. Perhaps some common export formats (like to javascript) are useful but others are mostly convenience methods or Pharo-compatibility methods.

> (6) DateAndTime instances would need to be immutable, to be interoperable with SmallDateAndTime. If you are using methods that do update a DateAndTime, such as offset: or beRounded, does your code expect the receiver to be modified?

We use the #offset: and #rounded methods, but threat them as if they would deliver copies of the original. So, yes, immutable please ;)


More information about the GemStone-Smalltalk mailing list