Lesson 41: The Script and Its Effect

Note! "getYear()" has been updated to "getFullYear()" because of it now being the year 2000.

The Script

     I've updated the script here to count down to January 1st, 2005 as the first day of the new millenium has already past.

<SCRIPT LANGUAGE="javascript">

RightNow = new Date()

mil = new Date("January 1, 2005")
mil.setYear = RightNow.getFullYear;
day = (1000*60*60*24)

computeDay = (mil.getTime() - RightNow.getTime()) / day;

DayResult = Math.round(computeDay);

document.write("<center> "+DayResult+" days until January 1<sup>st</sup>, 2005</center>");

The Script's Effect


Back to the Index Page