[Lazarus] DateDif function needed

Michael Van Canneyt michael at freepascal.org
Sat Nov 9 19:41:33 CET 2013

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.


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



More information about the Lazarus mailing list