case month of
  1,3,5,7,8,10,12:
    result:=31;  2:
    if (Year mod 4)=0 then
      result:=28
    else
      result:=29;  4,6,9,11:
    result:=30;其中的Month和Year你自己得到吧

解决方案 »

  1.   

    SysUtils都定义有。function GetDay(Year, Month: Word): Integer;
    begin
      Result := MonthDays[IsLeapYear(Year), Month];
    end;
      

  2.   

    实在不行就自己判断
    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');
    楼上说的函数没用过,你查查看吧
      

  3.   

    procedure TForm1.FormCreate(Sender: TObject);
    var i,j:word;
    begin
     i:=2002;
     j:=9;
     showmessage( inttostr(MonthDays[IsLeapYear(i),j]))
    end;
      

  4.   

    uses
      DateUtils;function DaysInMonth(const AValue: TDateTime): Word;
    function DaysInAMonth(const AYear, AMonth: Word): Word;
      

  5.   

    uses
      DateUtils,SysUtils;function DaysInMonth(const AValue: TDateTime): Word;
    function DaysInAMonth(const AYear, AMonth: Word): Word;
    function [IsLeapYear(Year), Month];Integer;