[Lazarus] DateDif function needed

waldo kitty wkitty42 at windstream.net
Sat Nov 16 16:09:00 CET 2013


On 11/16/2013 5:08 AM, John Landmesser wrote:
> This discussion seems to be finished ( 92 posts ) and i want to make a proposal
> as solution:
>
> Use the function DateDiff from Jedi ( RxLib ) ( JvJCLUtils.pas ).

that routine is actually a procedure... the one i posted is a function that 
returns the sought values ;)

> It's not perfect, but it works for me:
>
> **********************************************
>
> procedure DateDiff(Date1, Date2: TDateTime; var Days, Months, Years: word);

you have to feed this one with 5 variables... the one i posted you feed only 3 
variables and you get back a three field record... i've been working on also 
adding 3 more fields for hour, minutes and seconds ;)

plus, the name should be more in line with the actual process... 
CalendarDateDiff or CalendarDiff...

just my two cents, for what they're worth...

-- 
NOTE: No off-list assistance is given without prior approval.
       Please keep mailing list traffic on the list unless
       private contact is specifically requested and granted.




More information about the Lazarus mailing list