JavaScript getDay() Method: Date Object
Description
The getDay() method is used to get the day of the week of a given date according to local time.
The value returned by getDay() method is an integer corresponding to the day of the week: 0 for Sunday, 1 for Monday, 2 for Tuesday, 3 for Wednesday, 4 for Thursday, 5 for Friday, 6 for Saturday.
Version
Implemented in JavaScript 1.0
Syntax
getDay()

Example:
In the following web document, getDay() method returns the day of the week of a given date and current date.
View the example in the browser
Supported Browser
Internet Explorer 7 | Firefox 3.6 | Google Chrome 7 | Safari 5.0.1 | Opera 10 |
Yes | Yes | Yes | Yes | Yes |
See also:
JavaScript Core objects, methods, properties.
Previous: JavaScript getDate() Method: Date Object
Next: JavaScript getFullYear() Method: Date Object
Test your Programming skills with w3resource's quiz.
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics