SysUtils都定义有。function GetDay(Year, Month: Word): Integer; begin Result := MonthDays[IsLeapYear(Year), Month]; end;
实在不行就自己判断 if (month in [1,3,5,7,8,10,12]) then showmessage('31'); if (month in [4,6,9,11]) then showmessage('20'); f month=2 then showmessage('28'); 楼上说的函数没用过,你查查看吧
procedure TForm1.FormCreate(Sender: TObject); var i,j:word; begin i:=2002; j:=9; showmessage( inttostr(MonthDays[IsLeapYear(i),j])) end;
begin
Result := MonthDays[IsLeapYear(Year), Month];
end;
if (month in [1,3,5,7,8,10,12]) then
showmessage('31');
if (month in [4,6,9,11]) then
showmessage('20');
f month=2 then showmessage('28');
楼上说的函数没用过,你查查看吧
var i,j:word;
begin
i:=2002;
j:=9;
showmessage( inttostr(MonthDays[IsLeapYear(i),j]))
end;
DateUtils;function DaysInMonth(const AValue: TDateTime): Word;
function DaysInAMonth(const AYear, AMonth: Word): Word;
DateUtils,SysUtils;function DaysInMonth(const AValue: TDateTime): Word;
function DaysInAMonth(const AYear, AMonth: Word): Word;
function [IsLeapYear(Year), Month];Integer;