DAY_OF_YEAR

Use the DAY_OF_YEAR script function to return the day of the year for a given date.

Syntax

DAY_OF_YEAR ([DateFormat:]Date)

Parameters

Example

These examples convert a date to the day of year, and print the result in the activation report.

In the following example, the specified date is in a different format than YYMMDD or YYYYMMDD, so the script specifies the date format.

:SET &DAYNUMBER# =DAY_OF_YEAR("DD.MM.YY:31.12.00")

:PRINT &DAYNUMBER#

2000 was a leap year, so December 31 is the 366th day of that year:

2019-03-28 11:40:09 - U00020408 366

In the following example, the specified date is in YYMMDD format, so the script does not need to specify the current format.

:SET &DAYNUMBER# = DAY_OF_YEAR("190402")

:PRINT &DAYNUMBER#

April 2 is the 92nd day of the year in 2019:

2019-03-28 11:43:51 - U00020408 092

See also:

seealso

Script Date and Time Functions

Date, Time and Period Formats in Scripts