That's what i realized until now::

Quote of lhelp:
"MonthsBetween returns the number of whole months between ANow and AThen. This number is an approximation, based on an average number of days of 30.4375

per month (average over 4 years). This means the fractional part of a month is dropped."


MonthsBetween('01.01.2000', '01.03.2000') = 1(!!)

This wrong(!!) result is according to the explanation in the lhelp file, but this function is useless if you have leapyears in your period.



Fazit:

You can't write a DateDif function with the functions in DateUtils.pas ?!!

Giving up and using the Jedi DateDif function.



--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to