Unit 'DateUtils' Package
[Overview][Constants][Classes][Procedures and functions][Index] [#rtl]

DaysInAMonth

Number of days in a month of a certain year.

Declaration

Source position: dateutil.inc line 123

function DaysInAMonth(

  const AYear: Word;

  const AMonth: Word

):Word;

Arguments

AYear

  

Year in which the month occurs.

AMonth

  

Month of which the number of days should be returned.

Function result

The number of days in month AMonth, in year AYear.

Description

DaysInYMonth returns the number of days in the month AMonth in the yearAYear. The return value takes leap years into account.

See also

WeeksInAYear

  

Return the number of weeks in a given year.

WeeksInYear

  

return the number of weeks in the year, given a date.

DaysInYear

  

Return the number of days in the year in which a date occurs.

DaysInAYear

  

Number of days in a particular year.

DaysInMonth

  

Return the number of days in the month in which a date occurs.

Example

Program Example17;

{ This program demonstrates the DaysInAMonth function }

Uses SysUtils,DateUtils;

Var
  Y,M : Word;

Begin
  or:=1992 to 2010 do
    or:=1 to 12 do
      Writeln(LongMonthNames[m],' ',Y,' has ',DaysInAMonth(Y,M),' days.');
End.

Documentation generated on: Nov 23 2024