AndreasW: Countown auf ein bestimmtes datum!" Aber wie??

Beitrag lesen

Wie kann ich diesen Code verändern dass er nciht aufs alte Jahrteusend runterzählt, sondern auf den 4. November 2002 ??? Bitte brauche dringend Hilfe!!!!!!!!!!!!

Hiewr der Code:

<html>
<head>
<title>
Countdown to 2000
</title>
<script language="JavaScript">
var Temp2;
var timerID = null;
var timerRunning = false;
function showtime() {
now = new Date();
var CurHour = now.getHours();
var CurMinute = now.getMinutes();
var CurMonth = now.getMonth();
var CurDate = now.getDate();
var CurYear = now.getYear();
var CurSecond = now.getSeconds();
now = null;
Hourleft = 23 - CurHour
Minuteleft = 59 - CurMinute
Secondleft = 59 - CurSecond
var Yearleft = 99 - CurYear
var Monthleft = 12 - CurMonth
var Dateleft = 31 - CurDate
if (Yearleft!=1) {var ys="s"} else {var ys=""};
if (Monthleft!=1) {var mos="s"} else {var mos=""}
if (Dateleft!=1) {var ds="s"} else {var ds=""}
if (Hourleft!=1) {var hs="s"} else {var hs=""}
if (Minuteleft!=1) {var mis="s"} else {var mis=""}
if (Secondleft!=1) {var ss="s"} else {var ss=""}
Temp2='Still '+Yearleft+' year'+ys+', '+Monthleft+' month'+mos+', '+Dateleft+' day'+ds+', '+Hourleft+' hour'+hs+', '+Minuteleft+' minute'+mis+', '+Secondleft+' second'+ss+' left until the year 2000! '
Temp3=Yearleft+' year'+ys+', '+Monthleft+' month'+mos+', '+Dateleft+' day'+ds+', '+Hourleft+' hour'+hs+', '+Minuteleft+' minute'+mis+', '+Secondleft+' second'+ss
window.status=Temp2;
document.frm.left.value=Temp3;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
var timerID = null;
var timerRunning = false;
function stopclock () {
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function startclock () {
// Make sure the clock is stopped
stopclock();
showtime();
}

function countdown() {
nun = new Date();
var cknow = nun.getTime();
dann = new Date(2000, 0, 1);
ckdann = dann.getTime();
frist=(dann-nun)/1000;
frist=Math.round(frist);
frist="Das sind noch " + frist + " Sekunden!"
document.frm2.left.value=frist
timerID2 = setTimeout("countdown()",1000);
}

// -- End Hiding Here -->
</script>
</head>
<body bgcolor="#87cefa" onLoad="startclock(); countdown()">
<h3>Countdown zum neuen Jahrtausend</h3>
   <TABLE BORDER=4 CELLPADDING=0.5 CELLSPACING=0.5>
   <TR>
   <TD>
<b>
<form name="frm">
<div align=center valign=middle>
  <input type="textarea" name="left" size=60 value="Java">
</div>
</form>
</b>
   </td>
   </tr>
   </table>
<hr>
   <TABLE BORDER=4 CELLPADDING=0.5 CELLSPACING=0.5>
   <TR>
   <TD>
<b>
<form name="frm2">
<div align=center valign=middle>
  <input type="textarea" name="left" size=60 value="Java">
</div>
</form>
</b>
   </td>
   </tr>
   </table>

</body>
</html>