jquery 현재 날짜 (1) 썸네일형 리스트형 jquery 오늘 날짜 구하기 function getToday(){ var now = new Date(); var year = now.getFullYear(); var month = now.getMonth() + 1; //1월이 0으로 되기때문에 +1을 함. var date = now.getDate(); month = month >=10 ? month : "0" + month; date = date >= 10 ? date : "0" + date; // ""을 빼면 year + month (숫자+숫자) 됨.. ex) 2018 + 12 = 2030이 리턴됨. //console.log(""+year + month + date); return today = ""+year + month + date; } 이전 1 다음