DOWsInMonth Function
Returns the number of the specified Day of Week in the Given Month/Year.

Unit
QESBPCSDateTime

Declaration
Function DOWsInMonth(const DOW: Byte; const Month, Year: Word): Integer;

Description
Exception results for invalid DOW or invalid Month.

Parameters
DOW Day of the Week, Sunday = 1 through Saturday = 7
Month Desired Month in the range 1 through 12
Year Desired Year

Category
Date/Time Arithmetic Routines

Implementation

function DOWsInMonth (const DOW: Byte; const Month, Year: Word): Integer;
begin
     if (DOW < 1) or (DOW > 7) then
          raise EConvertError.Create (rsInvalidDOW);
     if (Month < 1) or (Month > 12) then
          raise EConvertError.Create (rsInvalidMonth);

     Result := DOWsInRange (DOW, GetFirstDayOfMonth (Month, Year), GetLastDayOfMonth (Month, Year));
End;


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