function clock(){ // The current time.
var t = new Date();
var daynow = t.getDay();
var zone = t.getTimezoneOffset();
var monthnow = t.getMonth();
var weekday = t.getDate();
var yearnow = t.getYear();
var hours = t.getHours();
var min = t.getMinutes();
var sec = t.getSeconds();
var status = "AM";
var tzone = new Array("13 hours ahead of","12 hours ahead of","11 hours ahead of","10 hours ahead of","9 hours ahead of","8 hours ahead of","7 hours ahead of","6 hours ahead of","5 hours ahead of","4 hours ahead of","3 hours ahead of","2 hours ahead of","1 hour ahead of","in","1 hour behind","2 hours behind","3 hours behind","4 hours behind","5 hours behind","6 hours behind","7 hours behind","8 hours behind","9 hours behind","10 hours behind","11 hours behind","12 hours behind");
var day = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var month = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var monthdate = new Array("0th","1st","2nd","3rd","4th","5th","6th","7th","8th","9th","10th","11th","12th","13th","14th","15th","16th","17th","18th","19th","20th","21st","22nd","23rd","24th","25th","26th","27th","28th","29th","30th","31st");
zone /= 60;
zone += 13;
if (yearnow < 2000)
yearnow += 1900;

if (hours == 12)
	status = "noon";
if (hours >= 13 && hours <= 23)
	status = "PM";

if (min < 10)
min = "0" + min;
if (sec < 10)
sec = "0" + sec;
window.setTimeout ("clock()", 900);
document.clock.time.value ="It is: " + hours + ":" + min + ":" + sec + " " + status + " on " + day[daynow] + ", " + month[monthnow] + " " + monthdate[weekday] + ", " + yearnow + ". You are " + tzone[zone] + " GMT.";
}
