getDay()

ES1+

Returns the day of the week (0-6) for the specified date according to local time.

Syntax

date.getDay()

Return Value

number

A number (0-6) representing the day of the week (0 = Sunday)

Examples

JavaScript
const date = new Date('2024-01-15'); // μ›”μš”μΌ
const days = ['일', 'μ›”', 'ν™”', '수', 'λͺ©', '금', 'ν† '];
console.log(date.getDay());
console.log(days[date.getDay()] + 'μš”μΌ');
Output:
// 1 μ›”μš”μΌ

Related Methods