JavaScript날짜setDate

setDate날짜

일을 설정합니다.

문법

date.setDate(day)

예제

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

const
new
setDate
of
the
console
const date = new Date(2024, 0, 15);
date.setDate(1);   // First of the month
console.log(date.getDate());   // 1