[Pharo-dev] Duration year

Hilaire hilaire at drgeo.eu
Sat Nov 22 06:03:03 EST 2014

I saw some discussion about Duration and year calculus in the list

Given that it is impossible to determine the number of days in a year
without the calendar years, should not 365.25 be used in place of 365 to
minimize the error ?

So it could look like:

Duration class >> years: aNumber
	^ self days: (aNumber * 365.25) truncated seconds: 0


Dr. Geo - http://drgeo.eu
iStoa - http://istoa.drgeo.eu

More information about the Pharo-dev mailing list