<div dir="ltr">Yes, the alternative is to get years as a float or fraction and truncate, but I think that would be a more costly calculation unless there is some trick to calculating the number of leap years between 2 years.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 25, 2021 at 4:59 PM tim Rowledge <<a href="mailto:tim@rowledge.org">tim@rowledge.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Yeah, it's 'interesting' like all date related stuff. Leap years add some extra joy.<br>
<br>
> On 2021-06-25, at 2:42 PM, Ken Causey <<a href="mailto:klcausey@gmail.com" target="_blank">klcausey@gmail.com</a>> wrote:<br>
> <br>
> This is the best I have managed, at least as a single line<br>
> <br>
> 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)<br>
> <br>
> This also works in Cuis.  Use of a variable for the birth date helps to reduce repetition of course.<br>
> <br>
> Ken<br>
> <br>
> On Fri, Jun 25, 2021 at 2:30 PM tim Rowledge <<a href="mailto:tim@rowledge.org" target="_blank">tim@rowledge.org</a>> wrote:<br>
> 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?<br>
> <br>
> tim<br>
> --<br>
> tim Rowledge; <a href="mailto:tim@rowledge.org" target="_blank">tim@rowledge.org</a>; <a href="http://www.rowledge.org/tim" rel="noreferrer" target="_blank">http://www.rowledge.org/tim</a><br>
> Strange OpCodes: LD: Lose Device<br>
> <br>
> <br>
> <br>
> <br>
<br>
<br>
tim<br>
--<br>
tim Rowledge; <a href="mailto:tim@rowledge.org" target="_blank">tim@rowledge.org</a>; <a href="http://www.rowledge.org/tim" rel="noreferrer" target="_blank">http://www.rowledge.org/tim</a><br>
"Bother" said Pooh as he said f**k in the wrong conf.<br>
<br>
<br>
<br>
</blockquote></div>