[javascript] Compare Date 특정시간과 현재 시간 비교
const initDate = new Date(2021, 5, 27, 12, 44, 30);//yyyy, mm, dd, hh, mm, ss function compareDate(targetDate){ let nowDate = new Date(); nowDate.setMonth(nowDate.getMonth() + 1); return targetDate < nowDate ? true : false } console.log(compareDate(initDate)); //특정시간이 지나면 true 출력