                 <!-- Paste this code into an external JavaScript file named: timeFormat.js  -->

/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Sandeep Gangadharan :: http://www.sivamdesign.com/scripts/ */



function formatTime() {
var arrayMonth = new Array(12)
       arrayMonth[0] = "January"
       arrayMonth[1] = "February"
       arrayMonth[2] = "March"
       arrayMonth[3] = "April"
       arrayMonth[4] = "May"
       arrayMonth[5] = "June"
       arrayMonth[6] = "July"
       arrayMonth[7] = "August"
       arrayMonth[8] = "September"
       arrayMonth[9] = "October"
       arrayMonth[10] = "November"
       arrayMonth[11] = "December"
  now = new Date();
  if (document.clock.sivamtime[0].checked) {
  month = now.getUTCMonth();
  day = now.getUTCDate();
  hour = now.getUTCHours();
  min = now.getUTCMinutes();
  sec = now.getUTCSeconds();
    if (min <= 9) {
      min = "0" + min; }
    if (sec <= 9) {
      sec = "0" + sec; }
    if (hour < 10) {
      hour = "0" + hour; }
    document.clock.date.value = arrayMonth.slice(month,month+1) + ' ' + day;
    document.clock.sivam.value = hour + ':' + min + ':' + sec + ' Z';
  }

  if (document.clock.sivamtime[1].checked) {
  month = now.getMonth();
  day = now.getDate();
  month = now.getMonth();
  day = now.getDate();
  hour = now.getHours();
  min = now.getMinutes();
  sec = now.getSeconds();
    if (min <= 9) {
      min = "0" + min; }
    if (sec <= 9) {
      sec = "0" + sec; }
    if (hour < 10) {
      hour = "0" + hour; }
    document.clock.date.value = arrayMonth.slice(month,month+1) + ' ' + day;
    document.clock.sivam.value = hour + ':' + min + ':' + sec;
  }

  setTimeout("formatTime()", 1000);
}

window.onload=formatTime;



