

//  ----------------  Start of ComputerTime  --------------------------------------------

function computertime ()
{
//  Defining the variables

var suffix = "";
var computertime = new Date()
var day = computertime.getDate()
var hours = computertime.getHours()
var minutes = computertime.getMinutes()
var thismonth=new Array("January","February","March","April","May","June","July","August",
                    "September","October","November","December")


//  Checking to see if minutes has only one digit
//  then padding out with a zero is this is true
if (minutes < 10){
minutes = "0" + minutes
}


//  Checking the original time taken from the computer and decide
//  if the time is am or pm and creating the correct suffix
if (hours < 12){
suffix = "am, ";
}
else{
suffix = "pm, ";
}


//  Check to set the time from Military time to 12 Hour Time 
//  check to see if it is more than 12
//  subtract the number from 12 in this case

if (hours == 0){
hours = 12;
}

if (hours > 12){
hours = hours - 12;
}


//  Write the correct time and date to the screen
document.write(hours + ":" + minutes + suffix );

document.write(computertime.getDate() + " "+thismonth[computertime.getMonth()])

}
//  ----------------  End of ComputerTime  --------------------------------------------


