The Document Object Model that we manipulate in JavaScript includes a
property that identifies the date and time the current document was
changed. If, in your code, you make a reference to
document.lastModified, you'll get a Date object (which you can just
print as a text string) indicating the relevant point in history.
A simple usage of the property looks like this:
document.write(document.lastModified)
Though precise formats vary among browsers and localities that code will
yield something like this:
08/12/2002 17:36:32
That is, it returns a mm/dd/yyyy date and hh:mm:ss time. The date and
time come from the operating system, and usually won't change if you
open, save, and close a file without modifying it. You can extract bits
and pieces of the date and time easily because it's a Date object. Use
the Date.getDate(), Date.getMonth(), and Date.getYear() methods to pull
out the pieces you want and reassemble them as you wish.
You'll find an application that uses the document.lastModified property,
complete with a utility that formats the date nicely and gets around
turn-of-the-millennium problems, here:
http://www.chami.com/tips/internet/041198I.html