Standard built-ins

Date.prototype.getDay()

Try the free JavaScript compiler

Local weekday number (Sunday is 0). Invalid date returns NaN. Local methods use host zone; example constructs local calendar fields.

Formal Syntax & Structure

javascript syntaxjavascript
date.getDay()

Return Value

Number

Calendar field or NaN.

Working Example

Example Snippetjavascript
console.log((new Date(2024,0,2,3)).getDay());
JavaScript Reference