daysbetween function? chech out help Bobby Clarke <[EMAIL PROTECTED]> wrote:Dave has exactly the right approach. Just watch that the Year needs to have 1900 or 2000 added. In this case it only matters if the 2-digit years are in different millennia as we are taking the difference. Even Leap Years are calculated the same 0 to 100 as 2000 to 2100 although back then they did the years very differently.
Bobby Clarke -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] Behalf Of Dave Sellers Sent: 30 June 2005 16:34 To: [email protected] Subject: Re: [delphi-en] about time fuction Something like: function NoOfDays(date1, date2: string) : integer; var D1, M1, Y1, D2, M2, Y2 : word; dt1, dt2 : TDateTime; begin D1 := StrToInt(Copy(date1,1,2)); M1 := StrToInt(Copy(date1,4,2)); Y1 := StrToInt(Copy(date1,7,2)); D2 := StrToInt(Copy(date2,1,2)); M2 := StrToInt(Copy(date2,4,2)); Y2 := StrToInt(Copy(date2,7,2)); dt1 := EncodeDate(Y1, M1, D1); dt2 := EncodeDate(Y2, M2, D2); Result := trunc(dt1 - dt2); end; ain't pretty but should give the number of whole days... Jose wrote: >Hi everyone. >Sorry the question but I am in a truoble. >I need a function that given to dates, in format, dd/mm/aa, returns de >difference in days between them. >Thanks in advance, >Jose > > >[Non-text portions of this message have been removed] > > > >----------------------------------------------------- >Home page: http://groups.yahoo.com/group/delphi-en/ >To unsubscribe: [EMAIL PROTECTED] >Yahoo! Groups Links > > > > > > > > > > ----------------------------------------------------- Home page: http://groups.yahoo.com/group/delphi-en/ To unsubscribe: [EMAIL PROTECTED] ---------------------------------------------------------------------------- -- YAHOO! GROUPS LINKS a.. Visit your group "delphi-en" on the web. b.. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. ---------------------------------------------------------------------------- -- [Non-text portions of this message have been removed] ----------------------------------------------------- Home page: http://groups.yahoo.com/group/delphi-en/ To unsubscribe: [EMAIL PROTECTED] --------------------------------- YAHOO! GROUPS LINKS Visit your group "delphi-en" on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. --------------------------------- Je krijgt wat je geeft __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com [Non-text portions of this message have been removed] ----------------------------------------------------- Home page: http://groups.yahoo.com/group/delphi-en/ To unsubscribe: [EMAIL PROTECTED] Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/delphi-en/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

