1 개요
# | 🔗 | 문제 | 풀이 |
---|
2 JavaScript
JavaScript
Copy
function isToday(date) {
return new Date().toDateString() == date.toDateString();
}
JavaScript
Copy
function isToday(date) {
return new Date().toString().substr(0, 15) == date.toString().substr(0, 15);
}
JavaScript
Copy
function isToday(date) {
var today = new Date();
if( date.getDate() != today.getDate() ) return false;
if( date.getMonth() != today.getMonth() ) return false;
if( date.getFullYear() != today.getFullYear() ) return false;
return true;
}
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.