What webserver are you running?
Basically you can just use
SSI = Server Side Include
Appache usually have this enable by default.
MS IIS usually have this disable. I just forgot how to set that up, but if you search MS site for SSI, it will give you instruction on how to setup SSI.
More info can be found here or your friendly search engine
http://tech.irt.org/articles/js166/#ssi_flastmod
[edit]
Well, if SSI is not an option maybe this (from NS JS Reference 1.3)
Code:
lastmod = document.lastModified // get string of last modified date
lastmoddate = Date.parse(lastmod)// convert modified string to date
if(lastmoddate == 0){// unknown date (or January 1, 1970 GMT)
document.writeln("Lastmodified: Unknown")
} else {
document.writeln("LastModified: " + lastmod)
}