[squeak-dev] Chronology and birthdays/ages
tim at rowledge.org
Fri Jun 25 21:59:04 UTC 2021
Yeah, it's 'interesting' like all date related stuff. Leap years add some extra joy.
> On 2021-06-25, at 2:42 PM, Ken Causey <klcausey at gmail.com> wrote:
> This is the best I have managed, at least as a single line
> Date current year - (Date year: 1971 month: 1 day: 5) year - ((Date year: 1971 month: 1 day: 5) dayOfYear < Date current dayOfYear ifTrue: 0 ifFalse: 1)
> This also works in Cuis. Use of a variable for the birth date helps to reduce repetition of course.
> On Fri, Jun 25, 2021 at 2:30 PM tim Rowledge <tim at rowledge.org> wrote:
> I was just looking at calculating an age from birth date and 'test' date and was startled to find no convenient method in the relevant classes. Given how many things Chronology does I'm convinced I must have missed sometihng obvious - but where?
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Strange OpCodes: LD: Lose Device
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
"Bother" said Pooh as he said f**k in the wrong conf.
More information about the Squeak-dev