JavaScript날짜getMonth

getMonth날짜

월을 반환합니다 (0~11, 0이 1월).

문법

date.getMonth()

예제

아래 값을 입력하면 예제에 즉시 반영됩니다.

const
new
June
console
getMonth
Jan
Jun
const date = new Date(2024, 5, 15);   // June 15
console.log(date.getMonth());   // 5 (0=Jan, 5=Jun)