DaysInYear Routines
Returns the number of days in the Year represented by the given Date.

Unit
QESBPCSDateTime

Overloaded Variants
Function DaysInYear(const DT: TDateTime): Integer;
Function DaysInYear(const Year: Word): Integer;
Function DaysInYear(const Year: Integer): Integer;

Declaration
Function DaysInYear(const DT: TDateTime): Integer;

Parameters
DT Date/Time to process.

Category
Date/Time Arithmetic Routines
Year Based Arithmetic Routines

Implementation

function DaysInYear (const DT: TDateTime): Integer;
begin
     if DateIsLeapYear (DT) then
          Result := 366
     else
          Result := 365;
End;

Declaration
Function DaysInYear(const Year: Word): Integer;

Implementation

function DaysInYear (const Year: Word): Integer;
begin
     if IsLeapYear (Year) then
          Result := 366
     else
          Result := 365;
End;

Declaration
Function DaysInYear(const Year: Integer): Integer;

Implementation

function DaysInYear (const Year: Integer): Integer;
begin
     if IsLeapYear (Year) then
          Result := 366
     else
          Result := 365;
End;


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