dcsimg

Assignment 41: A Possible Answer

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

Also - I have set the date to January 1st, 2005.

This:

<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);
mil.setMinutes = RightNow.getMinutes();
Minute = ((DayResult)*60)
computeMinute = (mil.getTime() - RightNow.getTime()) / Minute;
MinResult = Math.round(computeMinute);

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

</script>

 

Gives you this:

 

     You get the effect by grabbing the minute and figuring the number of minutes off of the DayResult figure, multiplied by 60.

 

Did You Get It?

 

Back to the Index Page