DaysInMonth(Month: Integer; Year: Integer): Integer;
Month. Number of the month in the specified year.
Year. Year.
The DaysInMonth method returns the number of days in the specified month of the specified year.
If incorrect data is entered, an exception is thrown.
Sub UserProc;
Var
i, i1: Integer;
Begin
i := DateTime.DaysInMonth(1, 2003);
i1 := DateTime.DaysInMonth(2, 2008);
End Sub UserProc;
After executing the example the "i" variable contains the 31 value, which is the number of days in January 2003, the "i1" variable contains 29, which is the number of days in February 2008.
See also: