반응형
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 출력
반응형
'FrontEnd > Javascript' 카테고리의 다른 글
웹 프론트엔드 간단한 성능 검사(Chrome Task Manager) (0) | 2022.06.21 |
---|---|
윈도우 nvm 설치 후 npm 버전 확인시 오류 해결하기 (0) | 2022.06.07 |
윈도우에서 nvm을 통한 node 설치 에러 (0) | 2022.06.07 |
[Javascript] Cover Up Scrolling layout. [스크롤시 덮이는 레이아웃] (0) | 2020.05.02 |
[Javascript] Array.prototype.find(callback[, thisArg]) (0) | 2020.04.16 |