/*
Routine to write date document modified
Parameters:
time True if time is to be displayed else False
e.g.
or
Note that if the server has failed to load up the HTTP header field with a
parsable date, nothing is written.
*/
function writeDateModified (time) {
var days = new Array; // Array to hold day names
var months = new Array; // Array to hold up month names
// Load up day names
days[0] = "sunday";
days[1] = "monday";
days[2] = "tuesday";
days[3] = "wednesday";
days[4] = "thursday";
days[5] = "friday";
days[6] = "saturday";
// Load up month names
months[0] = "january";
months[1] = "february";
months[2] = "march";
months[3] = "april";
months[4] = "may";
months[5] = "june";
months[6] = "july";
months[7] = "august";
months[8] = "september";
months[9] = "october";
months[10] = "november";
months[11] = "december";
// Assign date variables with document.lastModified
var modDate = new Date(Date.parse(document.lastModified));
// If we have a valid date reformat it.
if (modDate != 0) {
// Set up day variable to hold the name of the day
var day = days[modDate.getDay()];
// ndate variable holds day of month
var ndate = modDate.getDate();
// Set up month variable to hold the name of the month
var month = months[modDate.getMonth()];
// Get the year and if it is less than 1000 add 1900 to it.
var year = modDate.getYear();
if (year < 1000) year = year + 1900;
// Load up the time variables if required
if (time) {
var hour = modDate.getHours().toString();
if (hour.length == 1) hour = "0" + hour;
var minute = modDate.getMinutes().toString();
if (minute.length == 1) minute = "0" + minute;
var second = modDate.getSeconds().toString();
if (second.length == 1) second = "0" + second;
}
// Display date and time document was last updated.
document.write(day + " " + ndate + " " + month + " " + year+ " ");
if (time) {
document.write(hour + ":" + minute + ":" + second);
}
}
}