GetLastDayOfYear Routines
Returns Last Day of the Year, for a given Year.

Unit
QESBPCSDateTime

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

Declaration
Function GetLastDayOfYear(const Year: Word): TDateTime;

Parameters
Year the Year to be processed - should be 4 digit, eg 1999.
DT the Date to be processed.

Category
Date/Time Arithmetic Routines
Year Based Arithmetic Routines

Implementation

function GetLastDayOfYear (const Year: Word): TDateTime;
begin
     Result := OptEncodeDateW (Year, 12, 31);
End;

Declaration
Function GetLastDayOfYear(const Year: Integer): TDateTime;

Implementation

function GetLastDayOfYear (const Year: Integer): TDateTime;
begin
     Result := OptEncodeDateI (Year, 12, 31);
End;

Declaration
Function GetLastDayOfYear(const DT: TDateTime): TDateTime;

Implementation

function GetLastDayOfYear (const DT: TDateTime): TDateTime;
begin
     Result := GetLastDayOfYear (OptDate2Year (DT));
End;


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