On Sat, 9 Nov 2013, waldo kitty wrote:


digging deeper to work directly with YearsBetween and MonthsBetween shows that they seem to be missing the usual "+0.5" generally used to ensure that rounding is properly handled...

You misunderstood these functions.

There is no rounding necessary. The routines are correct.

Only FULL years/months/day must be counted.

See the documentation in e.g.

http://www.freepascal.org/docs-html/rtl/dateutils/yearsbetween.html

If you want partial years counted, you need the *Span functions.

http://www.freepascal.org/docs-html/rtl/dateutils/yearspan.html

Michael.

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to