[Lazarus] DateDif function needed

Michael Van Canneyt michael at freepascal.org
Tue Nov 12 07:49:19 CET 2013



On Tue, 12 Nov 2013, J├╝rgen Hestermann wrote:

> Am 2013-11-11 17:25, schrieb Michael Van Canneyt:
>> The number of elapsed DAYS between these 2 dates is 60.
>> If the average number of days per month is assumed to be 30.4375, then 2 
> full months would be 60.875 days.
>> That means that 60 days DOES NOT span 2 full months of 30.4375 days: it 
> falls 0.875 days short for that.
>> Hence, the *intended* result is 1.
>
> But dates from the 1st of a month to the 1st of the next month
> should be considered to span a full month, shouldn't it?
> If not, of what use would it be?
> A month is *not* defined to be 30.4375 days.
> Getting an average months is completely useless IMO.
> Who wants to get such a result for what purpose?

Like I said: you can argue whether the functions are useful.
They are there for Delphi compatibility.

Feel free to provide other functions, I will happily accept them.

Michael.


More information about the Lazarus mailing list