Best Download Sites Login
Site Login

Current Week of the year

Description
There are 52 weeks in a year, use this unique script to display the week we're currently in!...View A Script Demo


Do you find it confusing setting up these script?
Java Scripts Magic can do all the hard work for you all At The Touch Of A Button.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="Generator" CONTENT="TextPad 4.4">
<LINK href="general.css" rel="stylesheet" type="text/css">

</HEAD>

<BODY Background=../graphics/grayback.jpg>
<center><BR><BR><BR>
<SCRIPT Language="JavaScript">
<!--

//  Week of the year script- By Ada Shimar ( This e-mail address is being protected from spambots. You need JavaScript enabled to view it )
//  Based on code by Duncan Kabinu, Florida Department of Agriculture.

function weekNo() {
  var totalDays = 0;
  now = new Date();
  years=now.getYear()
  if (years < 1000)
  years+=1900
  var days = new Array(12);     // Array to hold the total days in a month
  days[0] = 31;
  days[2] = 31;
  days[3] = 30;
  days[4] = 31;
  days[5] = 30;
  days[6] = 31;
  days[7] = 31;
  days[8] = 30;
  days[9] = 31;
  days[10] = 30;
  days[11] = 31;

  //  Check to see if this is a leap year

   if (Math.round(now.getYear()/4) == now.getYear()/4) {
     days[1] = 29
  }else{
     days[1] = 28
  }

//  If this is January no need for any fancy calculation otherwise figure out the
//  total number of days to date and then determine what week

  if (now.getMonth() == 0) {
     totalDays = totalDays + now.getDate();
  }else{
     var curMonth = now.getMonth();
     for (var count = 1; count <= curMonth; count++) {
         totalDays = totalDays + days[count - 1];
     }
     totalDays = totalDays + now.getDate();
   }
   var week = Math.round(totalDays/7);
   return week;
}
document.write("Welcome to <b>week "+weekNo()+"<\/b> of "+years+"!")

// -->
 </SCRIPT>

</center>
</BODY>
</HTML>
 

Business Proposal If you have a Business Proposal that you think may be of interest to us here at Best Download Sites please contact us to discuss the matter in further detail