A Squeak-site + a datequestion

Phil Weichert weichert at hal-pc.org
Wed Oct 24 21:12:25 UTC 2001


Maarten,
  Delighted to see someone interested in documentation and willing to devote time
and effort to host a site.

As to the date question.  The second keyword, year:, is expected to be a four
digit year.  I went to the Date class method newDay:year: and looked at the
senders.  All senders used a four digit year.  Also the code in the method makes
more sense if the year is four digits because it does
daysInYear := self daysInYear: year


Evaluating the expression
     Date newDay: 129 year: (Date today year - 51)
is what you want to do.

Hope this helps!
Phil
<snip>

> "Transcript clear; show: (Date newDay: 129 year: -50)" the answer I get is
> "9 May 1950" which indeed is my date of birth. But by MY reckoning I am 51.
> Incidentally "Transcript clear; show: (Date today)" gives "24 October 2001"
> so today's date is correctly set.
>
> What is wrong here? Do I misunderstand something or does Squeak discount
> 2000 somehow, since it appears to miss a year of my age? Note "Transcript
> clear; show: (Date newDay: 129 year: -1)" gives "9 May 1999". Likewise
> "Transcript clear; show: (Date newDay: 1 year: -0)" gives "1 January 2000".
>
> Regards,
>
> Maarten.
>
> P.S. I am and remain for the moment on the list of mail-digests only.
>
> --------------------------------------------------------
> Maarten Maartensz.
> Website in Amsterdam about philosophy, logic,
> M.E. (Myalgic Encephalomyelitis) and much more:
> http://www.xs4all.nl/~maartens/
> more than 25 MB of stimulating and original ideas.
> ---------------------------------------------------------





More information about the Squeak-dev mailing list