Es extraño que no tengas la unidad DateUtils
, busca en la ruta
{Delphi5 Dir}\Source\Rtl\Common por algún lado debería estar.
Si no la encuentras aquí transcribo la función DaysInAMonth para que la implementes.
Código Delphi
[-]
const
MonthDays: array [Boolean] of TDayTable =
((31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31),
(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31));
function DaysInAMonth(const AYear, AMonth: Word): Word;
begin
Result := MonthDays[(AMonth = 2) and IsLeapYear(AYear), AMonth];
end;
function IsLeapYear(Year: Word): Boolean;
begin
Result := (Year mod 4 = 0) and ((Year mod 100 <> 0) or (Year mod 400 = 0));
end;
Un saludo.