JavaScript Date.prototype.getDay() Method
The getDay() method returns the day of the week of a date, from 0 (Sunday) to 6 (Saturday).
Description
The getDay() method returns the day of the week as a number, with Sunday as 0. For the day's name, use toLocaleDateString(locale, { weekday: 'long' }).
It's read-only: there's no setDay(), so to move to a particular weekday, calculate the difference in days and use setDate(). The week starts on Sunday in this numbering, but which day starts the week in a calendar differs by region; Intl.Locale can tell you for a given locale in supporting browsers.
Like the other get...() methods without "UTC" in their name, it uses the time zone of the user's device, so the same moment can give different results for users in different places. Each has a getUTC...() counterpart for UTC, and for showing a date in a particular time zone, toLocaleString() with the timeZone option is the easiest approach.
Syntax
date.getDay()Return Value
The day of the week in local time, from 0 (Sunday) to 6 (Saturday).
Example
Browser Support
The following information will show you the current browser support for the Date.prototype.getDay() method. Hover over a browser icon to see the version that first introduced support for this method.
Desktop





Tablets & Mobile





