Excuse me sir, Are you saved? (선생님, 구원받으셨습니까?)

If you died tonight, Are you going to heaven? (당신이 만약 오늘 밤 죽는다면, 천국에 갈 수 있습니까?)

For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life. (하나님이 세상을 이처럼 사랑하사 독생자를 주셨으니 이는 그를 믿는 자마다 멸망하지 않고 영생을 얻게 하려 하심이라)

-John 3:16 (요한복음 3장 16절)

분류 전체보기 (178)
Embeded (3)
.NET (13)
DB (6)
Javascript (0)
Visual Studio (0)
Project (7)
Experience (0)
General (13)
Car (0)
Story (12)
YBC (4)
Book (6)
Movie (1)
구 MiniHomepy (109)
Visitors up to today!
Today hit, Yesterday hit
daisy rss
2009. 5. 26. 17:24

SCRIPT LANGUAGE=\"JavaScript\";
!--
function addDay(yyyy, mm, dd, pDay) {
var oDate; // 리턴할 날짜 객체 선언
dd = dd*1 + pDay*1; // 날짜 계산
mm--; // 월은 0~11 이므로 하나 빼준다
oDate = new Date(yyyy, mm, dd) // 계산된 날짜 객체 생성 (객체에서 자동 계산)
return oDate;
}

function addMonth(yyyy, mm, dd, pMonth) {
var cDate; // 계산에 사용할 날짜 객체 선언
var oDate; // 리턴할 날짜 객체 선언
var cYear, cMonth, cDay // 계산된 날짜값이 할당될 변수
mm = mm*1 + ((pMonth*1)-1); // 월은 0~11 이므로 하나 빼준다
cDate = new Date(yyyy, mm, dd) // 계산된 날짜 객체 생성 (객체에서 자동 계산)
cYear = cDate.getFullYear(); // 계산된 년도 할당
cMonth = cDate.getMonth(); // 계산된 월 할당
cDay = cDate.getDate(); // 계산된 일자 할당
oDate = (dd == cDay) ? cDate : new Date(cYear, cMonth, 0); // 넘어간 월의 첫쨋날 에서 하루를 뺀 날짜 객체를 생성한다.
return oDate;
}

function calcDate(f) {
var cDate;
var y,m,d,i;
var frm = document.form1;

y = frm.yyyy.value;
m = frm.mm.value;
d = frm.dd.value;
i = frm.i.value;

if(f == 1 ) {
cDate = addDay(y, m, d, i)
} else {
cDate = addMonth(y, m, d, i)
}

frm.y.value = cDate.getFullYear();
frm.m.value = cDate.getMonth()+1;
frm.d.value = cDate.getDate();
}

//--;
/SCRIPT;
/head;
body;
form method=\"post\" name=\"form1\";
INPUT TYPE=\"text\" NAME=\"yyyy\" size=4 value=\"1999\";년
INPUT TYPE=\"text\" NAME=\"mm\" size=2 value=\"12\";월
INPUT TYPE=\"text\" NAME=\"dd\" size=2 value=\"31\";일
BR;
INPUT TYPE=\"text\" NAME=\"i\" size=2 value=\"2\";++BR;
input type=\"button\" onclick=\"calcDate(1)\" value=\"날짜 더하기\";
input type=\"button\" onclick=\"calcDate(0)\" value=\"월 더하기\";BR;
hr;
INPUT TYPE=\"text\" NAME=\"y\" size=4;년
INPUT TYPE=\"text\" NAME=\"m\" size=2;월
INPUT TYPE=\"text\" NAME=\"d\" size=2;일
/form;
/body;
/html;