Returns the day of the week corresponding to a specified date as a number from 0 to 6.

Syntax

<oRef>.getDay( )

<oRef>

The Date object whose corresponding weekday number you want to return.

Property of

Date

Description

The getDay( ) method returns the number of the day of the week on which a date falls. The number is zero-based:

Day

Number

Sunday

0

Monday

1

Tuesday

2

Wednesday

3

Thursday

4

Friday

5

Saturday

6

Note

The equivalent date function, DOW( ), is one-based, not zero-based.

The day of the week is the only date/time component you cannot set directly; there is no corresponding set- method. It is always based on the date itself.