Date.DayOfWeek

Syntax

 
Date.DayOfWeek(dateTime as any, optional firstDayOfWeek as nullable number) as nullable number

About

Returns a number (from 0 to 6) indicating the day of the week of the provided dateTime.

Example 1

Get the day of the week represented by Monday, February 21st, 2011, treating Sunday as the first day of the week.

Usage

Date.DayOfWeek(#date(2011, 02, 21), Day.Sunday)

Output

1

Example 2

Get the day of the week represented by Monday, February 21st, 2011, treating Monday as the first day of the week.

Usage

Date.DayOfWeek(#date(2011, 02, 21), Day.Monday)

Output

0