<!--
// Comments begin with //
// Get the current date
// The following statements declare variables
var today = new Date();

// Get the current month
var month = today.getMonth();

// Declare a variable called displayMonth
var displayMonth="";

// The following is a switch statement
// Attach a display name to each of 12 possible month numbers
  switch (month) {
      case 0 :
          displayMonth = "January"
          break
      case 1 :
          displayMonth = "February"
          break
      case 2 :
          displayMonth = "March"
          break
      case 3 :
          displayMonth = "April"
          break
      case 4 :
          displayMonth = "May"
          break
      case 5 :
          displayMonth = "June"
          break
      case 6 :
          displayMonth = "July"
          break
      case 7 :
          displayMonth = "August"
          break
      case 8 :
          displayMonth = "September"
          break
      case 9 :
          displayMonth = "October"
          break

      case 10 :
          displayMonth = "November"
          break
      case 11 :
          displayMonth = "December"
          break

      default: displayMonth = "INVALID"
  }

  // Set some more variables to make the JavaScript code
  // easier to read

      var hours = today.getHours();
      var minutes = today.getMinutes();
      var ampm;

      // We consider anything up until 12 a.m. "morning"

     if (hours <= 11) {
          ampm="am";

          // JavaScript reports midnight as 0, which is just
          // plain crazy; so we want to change 0 to 00.

          if (hours == 0) {
              hours = 00;

          }
      }

      // We consider anything after 12:00 a.m. to be "pm"

      else if (hours > 12) {
          ampm = "pm";

      }


      // We want the minutes to display with "0" in front
      // of them if they're single-digit. For example,
      // rather than 1:4 p.m., we want to see 1:04 p.m.

      if (minutes < 10) {
          minutes = "0" + minutes;
      }

     // + is a concatenation operator
     var displayGreeting = displayMonth + " "
             + today.getDate() + ", "
             + today.getFullYear()
             + " - "+ hours + ":" + minutes + " " + ampm

     document.writeln(displayGreeting)

//-->
   

