获得日期所在月份的天数
procedure TForm1.Button1Click(Sender: TObject);
var
Year, Month, Day: Word;
begin
DecodeDate(Now, Year, Month, Day);
Day := MonthDays[IsLeapYear(Year), Month];
ShowMessage(IntToStr(Day));
end;