On Saturday, 10 February 2024 at 23:48:56 UTC, Jonathan M Davis wrote:

If I understand correctly, he cares about how far into the month the dates are, whereas diffMonths ignores the smaller units, meaning that you get the
same result no matter when in the month the dates are. So,
2000-05-10 - 1990-05-09 would give 10, whereas 2000-05-10 - 1990-05-30
would give 9. diffMonths / 12 would give 10 in both cases.

I thought `diffMonths` was actually already taking this into account...

Looking at the impl, it's pretty simple.

Would it make sense to have an overload that takes into account the day as well as the month/year? This kind of stuff is sometimes tricky to get right.

-Steve

Reply via email to