DelphiBasics
DaysInAMonth
Function
Gives the number of days in a month DateUtils unit
 function DaysInAMonth(const Year, Month Word):Word;
Description
The DaysInAMonth function gives the number of days in a given Year and Month.
Related commands
DaysBetweenGives the whole number of days between 2 dates
DaysInAYearGives the number of days in a year
DaySpanGives the fractional number of days between 2 dates
MinsPerDayGives the number of minutes in a day
MonthDaysGives the number of days in a month
SecsPerDayGives the number of seconds in a day
 Download this web site as a Windows program.




 
Example code : How many days in February 2000 ?
begin
  // How many days in February 2000 ?
  ShowMessage('Days in February 2000 = '+
              IntToStr(DaysInAMonth(2000, 2)));
end;
Show full unit code
  Days in February 2000 = 29
 
Delphi Programming © Neil Moffatt 2002 - 2022. All rights reserved.  |  Home Page