[Lazarus] DateDif function needed

Michael Van Canneyt michael at freepascal.org
Wed Nov 13 21:59:46 CET 2013



On Wed, 13 Nov 2013, Reimar Grabowski wrote:

> On Tue, 12 Nov 2013 22:00:39 +0100 (CET)
> Michael Van Canneyt <michael at freepascal.org> wrote:
>
>> Seeing this, I can't help but think that the approximation approach
>> may not be such a bad idea after all :D
>
> Can you elaborate what the approximation is? I fail to see it.
> 1 julian year = 365.25 days of 86400 SI seconds each.
> Of course there are lots of other definitions for year but if FPC uses the julian one the value is exact and no approximation. And it is one of the year definitions that make sense as a unit of time (in contrast to calendar year ...)

The approximation is that the calculation is based on a difference in the number of days.

The number of days is then divided by an average number of days per month, 
in order to get a number of months.

Michael.




More information about the Lazarus mailing list