Mega Code Archive

 
Categories / Delphi / Algorithm Math
 

Find the number of days in actual month

Title: find the number of days in actual month? function DaysInMonth: Integer; var Year, Month, Day: Word; begin DecodeDate(Now, Year, Month, Day); Result := MonthDays[IsLeapYear(Year), Month]; end; procedure TForm1.Button1Click(Sender: TObject); begin ShowMessage(IntToStr(DaysInMonth)); end;