Hej NG...
Jeg har fundet en lille funktion, som lavet en countdown... men
tiden er client-side. Hvordan ændre man det til ServerTime?!
<HTML>
<HEAD>
<SCRIPT>
<!-- Countdown Script by Virtual_Max -->
<!--
http://www.geocities.com/siliconvalley/lakes/8620 -->
<!-- please keep this comment unchanged if you use it -->
<!-- hide script
//change your event date event here.
var eventdate = new Date("January 1, 2005 15:23:00 GMT");
function toSt(n)
{s=""
if(n<10) s+="0"
return s+n.toString();
}
function countdown()
{cl=document.clock;
d=new Date();
count=Math.floor((eventdate.getTime()-d.getTime())/1000);
if(count<=0)
{cl.days.value ="----";
cl.hours.value="--";
cl.mins.value="--";
cl.secs.value="--";
return;
}
cl.secs.value=toSt(count%60);
count=Math.floor(count/60);
cl.mins.value=toSt(count%60);
count=Math.floor(count/60);
cl.hours.value=toSt(count%24);
count=Math.floor(count/24);
cl.days.value=count;
setTimeout("countdown()",500);
}
// end script -->
</SCRIPT>
</HEAD>
<BODY TEXT="#FFFF80" BGCOLOR="#000000" LINK="#80FF00" VLINK="#FF00FF"
ALINK="#FF0000"
onLoad="countdown()">
<center>
<P>
<FORM name="clock"></P>
<CENTER>
<TABLE BORDER=5 CELLSPACING=5 CELLPADDING=0 BGCOLOR="#000000" >
<TR>
<TD ALIGN=CENTER WIDTH="31%" BGCOLOR="#000080"><B>Days:</B></TD>
<TD ALIGN=CENTER WIDTH="23%" BGCOLOR="#000080"><B>Hours:</B></TD>
<TD ALIGN=CENTER WIDTH="23%" BGCOLOR="#000080"><B>Mins:</B></TD>
<TD ALIGN=CENTER WIDTH="23%" BGCOLOR="#000080"><B>Secs:</B></TD>
</TR>
<TR>
<TD ALIGN=CENTER><INPUT name="days" size=4></TD>
<TD ALIGN=CENTER><INPUT name="hours" size=2></TD>
<TD ALIGN=CENTER><INPUT name="mins" size=2></TD>
<TD ALIGN=CENTER><INPUT name="secs" size=2></TD>
</TR>
<TR>
<TD COLSPAN="4" BGCOLOR="#000080">
<center><FONT SIZE=+2>Left before:</FONT></center>
</TD>
</TR>
<TR><TD COLSPAN="4" BGCOLOR="#000000"><CENTER><FONT SIZE=+1 COLOR="#00FF00">
<script>
document.write(" "+eventdate.toGMTString()+" ");
</script>
</FONT></CENTER></TD></TR>
</TABLE></CENTER>
<P></FORM></P>
</BODY>
</HTML>