>> KYSCORP.COM TUTORIALS >> Javascript Tutorials

Countdown

This will let you count the number of days remaining to reach a given event : for instance days left before we reach the year 2006:


<script language="javascript">

function chrono()
{
day=Date.parse("Jan 1, 2006 GMT") - Date.parse(new Date);
return(Math.round(day/(24*60*60*1000)))
}
document.write("Still "+chrono()+" days before we reach the year 2006");

</script>

Carpe diem people...