Well Folks Not To Hard Is It

    Now the fun starts. Even this is fairly easy. In this excample we start show you how to set up for hour by hour changing. Remember the first htm file from page before that contain "Today is XXXXXX and this notice will update at midnight for XXXXXX information". We will be changing that file to reflect time in hours. So we have our code from Dynamic Drive for Sunday threw Saturday. Now we point it to our htm file. The code for this section I first come acrose a question for auto updating at Get Satisfaction asking about auto updating. This code I believe came from www.w3school which also has a wealth of information. The code is as follows,

    <!--

    <script type="text/javascript">
    var d = new Date()
    var time = d.getHours()
    if (time<10)
      {
      document.write("<b>Good morning</b>");
      }
    else if (time>10 && time<16)
      {
      document.write("<b>Good day</b>");
      }
    else
      {
      document.write("<b>Hello World!</b>");
      }
    </script>

    -->

    That doesn't look to rough does it. We had crete a htm file and re-write the code as follows.

    <!--

     <style type=text/css>
    .today2
    {
    font: Bold Italic 20px Perpetua;
    color: #000000;
    }
    </style>

    <style type=text/css>
    .today1
    {
    font: Bold Italic 20px Perpetua;
    color: #EE0000;
    }
    </style>


    <html>
    <body>
    <p>
    <center><div class=today1>Hourly Updater</div></center>
    </p>
    <script type="text/javascript">
    var d = new Date();
    var time = d.getHours();

    if (time>=00 && time<01)
    {
    document.write("It's Midnight. <br>What else can one say<br>check back at the 1:00 A.M <br>for the next update ");
    }
    else if (time>=01 && time<02)
    {
    document.write("It's 1:00 A.M. <br>What else can one say <br>check back at the 2:00 A.M <br>for the next update ");
    }
    else if (time>=02 && time<03)
    {
    document.write("It's 2:00 A.M. <br>What else can one say <br>check back at the 3:00 A.M <br>for the next update ");
    }

    else if (time>=03 && time<04)
    {
    document.write("It's 3:00 A.M. <br>What else can one say <br>check back at the 4:00 A.M <br>for the next update ");
    }

    else if (time>=04 && time<05)
    {
    document.write("It's 4:00 A.M. <br>What else can one say <br>check back at the 5:00 A.M <br>for the next update ");
    }

    else if (time>=05 && time<06)
    {
    document.write("It's 5:00 A.M. <br>What else can one say <br>check back at the 6:00 A.M <br>for the next update ");
    }

    else if (time>=06 && time<07)
    {
    document.write("It's 6:00 A.M. <br>What else can one say <br>check back at the 7:00 A.M <br>for the next update ");
    }

    else if (time>=07 && time<08)
    {
    document.write("It's 7:00 A.M. <br>What else can one say <br>check back at the 8:00 A.M <br>for the next update ");
    }

    else if (time>=08 && time<09)
    {
    document.write("It's 8:00 A.M. <br>What else can one say <br>check back at the 9:00 A.M <br>for the next update ");
    }

    else if (time>=09 && time<10)
    {
    document.write("It's 9:00 A.M. <br>What else can one say <br>check back at the 10:00 A.M <br>for the next update ");
    }

    else if (time>=10 && time<11)
    {
    document.write("It's 10:00 A.M. <br>What else can one say <br>check back at the 11:00 A.M <br>for the next update ");
    }

    else if (time>=11 && time<12)
    {
    document.write("It's 11:00 A.M. <br>What else can one say <br>check back at the 12:00 P.M <br>for the next update ");
    }

    else if (time>=12 && time<13)
    {
    document.write("It's 12:00 P.M. <br>What else can one say <br>check back at the 2:00 P.M <br>for the next update ");
    }

    else if (time>=13 && time<14)
    {
    document.write("It's 1:00 P.M. <br>What else can one say <br>check back at the 2:00 P.M <br>for the next update ");
    }
    else if (time>=14 && time<15)
    {
    document.write("It's 2:00 P.M. <br>What else can one say <br>check back at the 3:00 P.M <br>for the next update ");
    }

    else if (time>=15 && time<16)
    {
    document.write("It's 3:00 P.M. <br>What else can one say <br>check back at the 4:00 P.M <br>for the next update ");
    }
    else if (time>=16 && time<17)
    {
    document.write("It's 4:00 P.M. <br>What else can one say <br>check back at the 5:00 P.M <br>for the next update ");
    }
    else if (time>=17 && time<18)
    {
    document.write("It's 5:00 P.M. <br>What else can one say <br>check back at the 6:00 P.M <br>for the next update ");
    }
    else if (time>=18 && time<19)
    {
    document.write("It's 6:00 P.M. <br>What else can one say <br>check back at the 7:00 P.M <br>for the next update ");
    }
    else if (time>=19 && time<20)
    {
    document.write("It's 7:00 P.M. <br>What else can one say <br>check back at the 8:00 P.M <br>for the next update ");
    }
    else if (time>=20 && time<21)
    {
    document.write("It's 8:00 P.M. <br>What else can one say <br>check back at the 9:00 A.M <br>for the next update ");
    }
    else if (time>=21 && time<22)
    {
    document.write("It's 9:00 P.M. <br>What else can one say <br>check back at the 10:00 P.M <br>for the next update ");
    }
    else if (time>=22 && time<23)
    {
    document.write("It's 10:00 P.M. <br>What else can one say <br>check back at the 11:00 P.M <br>for the next update ");
    }
    else if (time>=23 && time<24)
    {
    document.write("It's 11:00 P.M. <br>What else can one say <br>check back at the Midnight <br>for the next update ");
    }

    </script>

    Not bad is it. This will give us a hour by hour up date.
    Since we are going to have a repeating message by hour and minute we don't have to be to fancy. What we have to do is change the days of the week (Monday, Tuesday, Wednesday, etc.)to having just one file. This is what we have to change in our code,
    DAILY
    daycontent[1]="resources/demo/monday.htm" //Monday content
    daycontent[2]="resources/demo/tuesday.htm" //Tuesday content
    daycontent[3]="resources/demo/wednesday.htm"
    daycontent[4]="resources/demo/thursday.htm"
    daycontent[5]="resources/demo/friday.htm"
    daycontent[6]="resources/demo/saturday.htm"
    daycontent[0]="resources/demo/sunday.htm"

    And Change to
    HOURLY
    daycontent[1]="resources/demo/sampleh.htm" //Monday content
    daycontent[2]="resources/demo/sampleh.htm" //Tuesday content
    daycontent[3]="resources/demo/sampleh.htm"
    daycontent[4]="resources/demo/sampleh.htm"
    daycontent[5]="resources/demo/sampleh.htm"
    daycontent[6]="resources/demo/sampleh.htm"
    daycontent[0]="resources/demo/sampleh.htm"

    The only diference is that Daily has a different file for every day that changes once per day.
    The Hourly Updater Change message once per hour.
    Here's a working excample.
    Ready For he Next Section "Minutes"