DayOfTheYear returns the number of days between a specified TDateTime value and 31st December of the previous year, as specified by AValue.
You would use this function DayOfTheYear to obtain the ordinal position of day within its year.
A TDateTime value that refers to 1st January generates a result of 1; 2nd January returns a 2; 1st February returns 32, e.t.c.
Declaration: function DayOfTheYear(const AValue: TDateTime): Word;
A code example follows.