script

javascript 현재 날짜 출력하여 뿌려주기

2hansoul 2022. 1. 20. 21:52
반응형
function today(){

var today = new Date();  //현재 일자
var year = today.getFullYear(); // 년도
var month = today.getMonth() + 1;  // 월
var day = today.getDay();  // 요일

var estday=(year+"년"+""+month+"월"+""+day+"일");

$('#estimateday').html(estday); //밑에 p 태그에 뿌려주기 위해 설정
}

<p id="estimateday" style="text-align:center"></p>

 

반응형