Team:KAIST-Korea/Test Count

From 2011.igem.org

(Difference between revisions)
Line 1: Line 1:
<HTML>
<HTML>
<HEAD>
<HEAD>
-
 
<SCRIPT LANGUAGE="JavaScript">
<SCRIPT LANGUAGE="JavaScript">
-
<!--
+
function getTime()  
-
function getTime() {
+
{
-
now = new Date();
+
      now = new Date();
-
dday = new Date("Nov 8 2011 00:00:00");
+
      dday = new Date("Nov 8 2011 00:00:00");
-
// 지정일을 위와 같은 형식으로 설정 합니다
+
      days = (dday - now) / 1000 / 60 / 60 / 24;
-
days = (dday - now) / 1000 / 60 / 60 / 24;
+
      daysRound = Math.floor(days);
-
daysRound = Math.floor(days);
+
      hours = (dday - now) / 1000 / 60 / 60 - (24 * daysRound);
-
hours = (dday - now) / 1000 / 60 / 60 - (24 * daysRound);
+
      hoursRound = Math.floor(hours);
-
hoursRound = Math.floor(hours);
+
      minutes = (dday - now) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound);
-
minutes = (dday - now) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound);
+
      minutesRound = Math.floor(minutes);
-
minutesRound = Math.floor(minutes);
+
      seconds = (dday - now) / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound);
-
seconds = (dday - now) / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound);
+
      secondsRound = Math.round(seconds);
-
secondsRound = Math.round(seconds);
+
-
document.timeForm.input1.value = daysRound  + "Days " + hoursRound + ":" + minutesRound + ":" + secondsRound;
+
      document.timeForm.input1.value = daysRound  + "Days " + hoursRound + ":" + minutesRound + ":" + secondsRound;
-
newtime = window.setTimeout("getTime();", 1000);
+
      newtime = window.setTimeout("getTime();", 1000);
-
document.timeForm.input2.value = daysRound  + "Days " + hoursRound + ":" + minutesRound + ":" + secondsRound;
+
-
newtime = window.setTimeout("getTime();", 1000);
+
}
}
-
//  -->
+
 
</script>
</script>
-
 
-
<!------- 여기까지 ----->
 
</HEAD>
</HEAD>
-
<!------- 2. BODY 태그안에 있는 내용을 복사해 넣으세요 --------->
 
<BODY onLoad="getTime()">
<BODY onLoad="getTime()">
-
<!------- 여기까지 ----->
 
<style>
<style>
Line 43: Line 35:
</style>
</style>
-
<!------- 3. 원하는 위치에 아래의 내용을 복사해 넣으세요 -------->
 
<p align=center>
<p align=center>
<form name=timeForm>
<form name=timeForm>
<input type=text name=input1 size=20 border-style="none" style="border-bottom: 0px solid; border-left: 0px solid;border-right: 0px solid;border-top: 0px solid;font:30px arial, helvetica,sans-serif; color:black"></form>
<input type=text name=input1 size=20 border-style="none" style="border-bottom: 0px solid; border-left: 0px solid;border-right: 0px solid;border-top: 0px solid;font:30px arial, helvetica,sans-serif; color:black"></form>
-
<br>
 
-
<input type=text name=input2 size=20 border-style="none" style="border-bottom: 0px solid; border-left: 0px solid;border-right: 0px solid;border-top: 0px solid;font:30px arial, helvetica,sans-serif; color:black"></form>
 
</center>
</center>

Revision as of 10:18, 8 July 2011