var xmlHttp;

function srvTime() {

if (window.XMLHttpRequest) {// 분기하지 않으면 IE에서만 작동된다.

xmlHttp = new XMLHttpRequest(); // IE 7.0 이상, 크롬, 파이어폭스 등

xmlHttp.open('HEAD', window.location.href.toString(), false);

xmlHttp.setRequestHeader("Content-Type", "text/html");

xmlHttp.send('');

return xmlHttp.getResponseHeader("Date");

} else if (window.ActiveXObject) {

xmlHttp = new ActiveXObject('Msxml2.XMLHTTP');

xmlHttp.open('HEAD', window.location.href.toString(), false);

xmlHttp.setRequestHeader("Content-Type", "text/html");

xmlHttp.send('');

return xmlHttp.getResponseHeader("Date");

}

}

var st = srvTime();

var date = new Date(st);

var today = date.getFullYear() + addZero(date.getMonth() + 1)

+ addZero(date.getDate());


function addZero(n) {

return n < 10 ? "0" + n : n;

}





Posted by 좀모씨

블로그 이미지
Under Construction
좀모씨
Yesterday
Today
Total

달력

 « |  » 2024.3
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함