Return the day of the week:
The result of n will be:
The getDay() method returns the day of the week (from 0 to 6) for the specified date.
Note: Sunday is 0, Monday is 1, and so on.
![]()
The getDay() method is supported in all major browsers.
| Type | Description |
|---|---|
| Number | A Number, from 0 to 6, representing the day of the week |
| JavaScript Version: | 1.0 |
|---|
Return the name of the weekday (not just a number):
The result of n will be:
JavaScript Date Object
Your message has been sent to W3Schools.