The function DaysInYear returns the number of days in the year that has been specified by the given date, and can be used to determine whether the specified year is a leap year or not.
Declaration: function DaysInYear(const AValue: TDateTime): Word;
The following example shows several ways of achieving and displaying a result.