DaysPerMonth function
Date/Time routines |
![]() ![]() ![]() |
acUtils
|
function DaysPerMonth(AYear: Integer; AMonth: Word): Byte;
|
The DaysPerMonth returns the number of days in specified month of year.
|
function DaysPerMonth(AYear: Integer; AMonth: Word): Byte;
|
const
|
DaysInMonth: Array[1..12] of Integer = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
|
begin
|
Result := DaysInMonth[AMonth];
|
if (AMonth = 2) and IsLeapYear(AYear) then Inc(Result); // leap-year Feb is special
|
end;
|