[JAVASCRIPT] Convert Date format
첫번째 방법 function convertDateFormat(date) { var year = date.getFullYear(); var month = date.getMonth() + 1; month = month >= 10 ? month : '0' + month; var day = date.getDate(); day = day >= 10 ? day : '0' + day; return [year, month, day].join('-'); } var date = new Date(); var convertedDate = convertDateFormat(new Date()); console.log(date); console.log(convertedDate); // 출력 // Tue May 25 2021 01:..
2021.09.02