>>> this example in Swedish
>>> this example in French
This script displays the last modification date on the page.
If the server does not supply this last modified date, the date displayed will be January 1, 1970. More further down about how to avoid this.
document.write("Last modified " + document.lastModified)
displays the modification date of the page like this:
Anything within quotation marks will be written as is on the page; you can easily replace the text "Last modified " by something else.
Netscape och MIE 3- displays the last modified date as local; MIE 4 display it in GMT (Greenwich Mean Time).
The format varies from one browser to another; this is for instance what it looks like in my
Here is a script that checks the date string before writing it on the page. Put it within SCRIPT tags (see MINIMANUAL 1 basics) and on the spot where you want the date to be displayed.
var datumet = document.lastModified
var datumnum = Date.parse(datumet)
document.writeln("Last modified: " +datumet)
//incomprehensible text string
//just write it
if(datumnum == 0)
document.writeln("Last modified: unknown date")
//no date received from server
//if no code, 1970 would be displayed
//this is where you could put
//code that rewrites the date
//the way you want it
document.writeln("Last modified: " + datumet)
Last modified: December 4, 1997
This page should be part of a frames system