
Originally Posted by
snb
Yes, it is no problem, unless you assume that a 'month' is a fixed quantity. Since it isn't it will produce odd results at first glance only.
From 28 feb to 28 may is 4 months, until the 7th of june is 29,30,31 may + 7 days in june: 10 day in total
From 01 march to the first of june is also 4 months (but comprising more days than the 3 months from 28 feb to 28 may).
If you count in days, the difference must be 1, if you count in months & days, the result will differ dependent of the period in the year you are counting with.
That's the nice thing about dates: it's a miixed 365,25 -number system, 12-number system, alternating 28,29,30,31-number system.
So both our methods produce the correct results.
Bookmarks