Automation Engine Script Guide > Ordered by Function > Date and Time > WEEKDAY_NR

WEEKDAY_NR

Script Functions: Returns the day of a week of a given date as a number

Syntax

WEEKDAY_NR(Date)

Syntax

Description/Format

Date

Indication of a date in the format "YYMMDD" or "YYYYMMDD".

Format: script literal or script variable

It is also possible to specify a different date format. Do so by entering the required date format, then enter a separator (: or ;) and afterwards the date. Indicating a date format is optional.


Return codes

"1" - Monday
"2" - Tuesday
"3" - Wednesday
"4" - Thursday
"5" - Friday
"6" - Saturday
"7" - Sunday

Comments

Optionally, you may specify a particular Date Format. The default Date Formats to be used are "YYMMDD" or "YYYYMMDD". A colon or semicolon may be used as a separator between Date Format and Date.

Examples

In these examples, the functions return the values "5" and "6" for the specified date.

:SET &SILVESTER_2000# = WEEKDAY_NR('DD.MM.YY:31.12.99')
:
SET &NEWYEAR_2000# = WEEKDAY_NR("DD.MM.YYYY:01.01.2000")

 

See also:

Script element Description

WEEK_NR

Returns the calendar week of a date.
WEEKDAY_XX Returns the day of the week of a given date as an abbreviation.

Script Elements - Date and Time

Date, Time and Period Formats

About Scripts
Script Elements - Alphabetical Listing

Script Elements - Ordered by Function