[JS] 현재 날짜 구하기

yeni·2022년 11월 7일
0

오늘의 날짜

new Date();
//Mon Nov 07 2022 10:48:48 GMT+0900 (한국 표준시)

const pickDate = new Date()

pickDate.getFullYear()
//2022

pickDate.getMonth()
//10
pickDate.getMonth() + 1
//11
//월은 +1 을 해주어야 오늘의 월이 출력된다.

pickData.getDate()
//7


console.log(`${year}-${month}-${date}`);
//2022-11-7
profile
차곡차곡 쌓는 몌으니 개발노트

0개의 댓글