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); | + | |
} | } | ||
- | + | ||
</script> | </script> | ||
- | |||
- | |||
</HEAD> | </HEAD> | ||
- | |||
<BODY onLoad="getTime()"> | <BODY onLoad="getTime()"> | ||
- | |||
<style> | <style> | ||
Line 43: | Line 35: | ||
</style> | </style> | ||
- | |||
<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> | ||
- | |||
- | |||
</center> | </center> | ||
Revision as of 10:18, 8 July 2011