JavaScript日付getDay

曜日を返します(0=日曜〜6=土曜)。

構文

date.getDay()

使用例

下記の値を入力するとサンプルに即時反映されます。

const
new
Monday
console
getDay
Sun
Mon
const date = new Date(2024, 0, 1);   // Monday
console.log(date.getDay());   // 1 (0=Sun, 1=Mon)