[Lazarus] DateDif function needed

José Mejuto joshyfun at gmail.com
Thu Nov 14 13:25:54 CET 2013


El 14/11/2013 7:56, Patrick Chevalley escribió:

> All this efforts are to bypass the problem with the calendar year (the
> one you mention) because it is sometime 365 and sometime 366 days. This
> is a totally unacceptable definition when you need an homogeneous time
> scale.

Hello,

I was following this thread about the years, months, days, datediff and 
almost all people expect that dates:

2013/05/15 - 2013/07/16

Return 2 months + 1 day, but I expect it to return 1 month and 16+16 
days, because month definition out of context is around 30.43.... So in 
the above example for sure 1 months has been passed and 32 days, then 
you can decide if 32 days is 1 month plus or not.

The same applies to years:

1999/02/28 - 2000/02/29 = 1 Year
2000/02/27 - 2001/02/28 = 1 Year + 1 day
2000/02/28 - 2001/02/28 = 1 Year
2000/02/29 - 2001/02/28 = 1 Year
2000/02/29 - 2001/03/01 = 1 Year + 1 day

2001/05/2 - 2002/06/30 = 1 Year + 29+30 days

Maybe I'm completly wrong ?

-- 





More information about the Lazarus mailing list