var now = new Date(); var year= now.getFullYear(); var mon = (now.getMonth()+1)>9 ? ''+(now.getMonth()+1) : '0'+(now.getMonth()+1); var day = now.getDate()>9 ? ''+now.getDate() : '0'+now.getDate(); alert(year + mon + day); alert(year + '년 ' + mon + '월 ' + day + '일'); alert(year + '-'+ mon+ '-' + day);