Date.prototype.getDay()

Returns the day of the week of a date in local time.

Since ES1 Spec ↗

Syntax

date.getDay()

Returns

number — The weekday, 0 (Sunday) through 6 (Saturday).

Examples

const d = new Date("2026-05-15T12:00:00");
console.log(d.getDay());
Output
5
const days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
const d = new Date("2026-05-15T12:00:00");
console.log(days[d.getDay()]);
Output
Fri

Notes

- Sunday is `0` and Saturday is `6`. - Do not confuse with `getDate()`, which returns the day of the month. - Use `getUTCDay()` for the UTC weekday.

Browser & runtime support

EnvironmentSince version
chrome 1.0
firefox 1.0
safari 1.0
edge 12
node 0.10

See also