The function DaysInMonth returns the number of days in the month that has been specified by the given date.
Declaration: function DaysInMonth(const AValue: TDateTime): Word;
The following example shows several ways of achieving and displaying a result.