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
μμμΌ