Get Day of Year

GetDayOfYear

The GetDayOfYear procedure returns the day of the year for the given date.

The GetDayOfYear procedure returns the day of the year as a numeric value (1 to 366).

day-of-year GetDayOfYear(
  InDate           D   Const Datfmt(*ISO) OPTIONS(*NOPASS)
)

See also: GetDayName GetDayEx

Parameters

inDate  [ optional ]
[input DateFmt(*ISO) const]  Any valid date data-type, including date fields and date literals. Since this parameter is read-only (CONST) the date value may be in any valid date format. If this parameter is not specified, the current system date is used as the basis for the calculation.

Return Value

The return value is an integer in the range 1 to 366. The number represents the day of the year.

If the function fails, the return value is -1.