
// Date program beginning

function MakeArray(n) {
	this.length = n;
	return this;
}

<!-- Give the week days -->

wkName = new MakeArray(7);
wkName[1] = "Monday";
wkName[2] = "Tuesday";
wkName[3] = "Wednesday";
wkName[4] = "Thursday";
wkName[5] = "Friday";
wkName[6] = "Saturday";
wkName[7] = "Sunday";

<!-- Give the month names -->

mthName = new MakeArray(12);
mthName[1] = "January";
mthName[2] = "February";
mthName[3] = "March";
mthName[4] = "April";
mthName[5] = "May";
mthName[6] = "June";
mthName[7] = "July";
mthName[8] = "August";
mthName[9] = "September";
mthName[10] = "October";
mthName[11] = "November";
mthName[12] = "December";

function displayDate() {
currentTime = new Date();
var thisDay = wkName[currentTime.getDay()];
var thisDate = currentTime.getDate();
if (currentTime.getDate() <10)
  thisDate = "0" + currentTime.getDate(); 
var thisMonth = mthName[currentTime.getMonth() + 1];
var thisYear = currentTime.getFullYear();
var thisTime = thisDay + " " + thisDate + " " + thisMonth + " " + thisYear;
document.write(thisTime);
}