Favorites

JavaScript Date.prototype.getDay() Method

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Date.prototype.getDay()
JavaScript Date Instance methodThis method is supported by all modern browsers.
Updated 28th November 2026

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

const d = new Date(2026, 10, 28);
console.log(d.getDay());
console.log(d.getDay() === 0 || d.getDay() === 6 ? 'Weekend' : 'Weekday');
console.log(d.toLocaleDateString('en', { weekday: 'long' }));

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.

This method is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee