DaysInAYear returns the number of days in the year of the value specified by AYear.

AYear accepts values within the range of 1 to 9999 inclusive.

Declaration: Function DaysInAYear(const AYear: Word): Word;

An example follows.

procedure ScriptEvent(var Value:Variant);
var
TheYear, NumDays : word;
begin
TheYear := 2024;
NumDays := DaysInAYear(TheYear);
LogInfo('Number of days in the year - '+IntToStr(NumDays));
 
NumDays := DaysInAYear(TheYear+1);
LogInfo('Number of days in the year - '+IntToStr(NumDays));
LogInfo('');
end;