F. Senault schrieb:
>>> (d1.year - d2.year) - (d1.yday >= d2.yday ? 0 : 1)
Pardon Fred, using #yday would be short and nice, but this doesn't work
reliably if one year is a leap year and the other is not. Try it with
d1 = Date.new(2007, 3, 1); d2 = Date.new(2004, 3, 1)
d1 = Date.new(2004, 3, 1); d2 = Date.new(2001, 3, 2)
Regards,
Pit