WEEKDAY_NR

Use the WEEKDAY_NR script function to return the day of the week of a particular date. The weekday is returned as a single-digit number.

Syntax

WEEKDAY_NR ([DateFormat:]Date)

Parameters

Return Codes

The script function returns the following values:

Examples

December 31, 1999 was a Friday, so the following script returns the value 5:

:SET &NEWYEARSEVE_2000# = WEEKDAY_NR('DD.MM.YY:31.12.99')

January 1, 2000 was a Saturday, so the following script returns the value 6:

:SET &NEWYEAR_2000# = WEEKDAY_NR("DD.MM.YYYY:01.01.2000")

In both examples, the date format is specified because the dates provided are not in YYMMDD or YYYYMMDD format.

See also:

seealso

Script Date and Time Functions

Date, Time and Period Formats in Scripts