Easy Tutorial
❮ Prop Canvas Shadowcolor Prop Area Hash ❯

JavaScript getDay() Method

JavaScript Date Object

Example

Returns the numeric day of the week.

n Output:


Definition and Usage

The getDay() method returns the numeric day of the week (0-6).

Note: Sunday is 0, Monday is 1, and so on.


Browser Support

All major browsers support the getDay() method.


Syntax

Return Value

Type Description
Number Returns an integer between 0 (Sunday) and 6 (Saturday).

Technical Details

| JavaScript Version: | 1.0 | | --- | --- |


More Examples

Example

Returns the name of the day of the week (not a number):

n Output:


JavaScript Date Object

❮ Prop Canvas Shadowcolor Prop Area Hash ❯