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
-
DAY_OF_YEAR
Converts a date to the day of year -
DateFormat
(Optional) Specifies the format of the date
More Information:Date, Time and Period Formats in Scripts
Note: Use this parameter if the date that you specify is not in YYMMDD or YYYYMMDD format. Separate the date format and the date with a colon or semicolon. -
Date
Date in YYMMDD or YYYYMMDD format
Format: script literal or script variable
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: