Compatible
with IE and Netscape
You can display a realtime countdown to any date and time using this
script. It is freeware as long as you do not remove the header which
points to me as the author and this website. Make sure the code is
cut and pasted between the <head> </head> tags, the form
that displays the actual time can go anywhere on your webpage.
Countdown To
September 29, 2007 at 12:01AM (TDavid's birthday, btw):
CODE IS BELOW:
<head>
<script LANGUAGE="JavaScript">
<!--
// Javascript Countdown
// Version 1.01 6/7/07 (1/20/2000)
// by TDavid at http://www.tdscripts.com/
var now = new Date();
var theevent = new Date("Sep 29 2007 00:00:01");
var seconds = (theevent - now) / 1000;
var minutes = seconds / 60;
var hours = minutes / 60;
var days = hours / 24;
ID=window.setTimeout("update();", 1000);
function update() {
now = new Date();
seconds = (theevent - now) / 1000;
seconds = Math.round(seconds);
minutes = seconds / 60;
minutes = Math.round(minutes);
hours = minutes / 60;
hours = Math.round(hours);
days = hours / 24;
days = Math.round(days);
document.form1.days.value = days;
document.form1.hours.value = hours;
document.form1.minutes.value = minutes;
document.form1.seconds.value = seconds;
ID=window.setTimeout("update();",1000);
}
// --></script>
</head>
<body>
<p><font
face="Arial" size="3">Countdown To January
31, 2000, at 12:00: </font></p>
<form name="form1"><p>Days <input
type="text" name="days" value="0"
size="3"> Hours
<input type="text" name="hours"
value="0" size="4"> Minutes <input
type="text" name="minutes" value="0"
size="7"> Seconds <input type="text"
name="seconds" value="0" size="7">
</p>
</form>
</body>
</html> |