CalendarWeeksApart Function
Returns the Number of Calendar Weeks between DT2 and DT1.

Unit
QESBPCSDateTime

Declaration
Function CalendarWeeksApart(const DT1, DT2: TDateTime): LongInt;

Description
A Calendar Week is taken as starting with Sunday. If result is 0 then they are in within the same Calendar Week, if result is negative then DT2 occurs in a Calendar Week before DT1.

Parameters
DT1 First Date/Time to process.
DT2 Second Date/Time to process.

Category
Date/Time Arithmetic Routines
Week Based Arithmetic Routines

Implementation

function CalendarWeeksApart (const DT1, DT2: TDateTime): Integer;
begin
     Result := WeeksApart (StartOfWeek (DT1), StartOfWeek (DT2));
End;


HTML generated by Time2HELP
http://www.time2help.com