PDA

View Full Version : "This page was last updated.." question


ssskaya
11-01-2002, 12:45 AM
I use the following script to show when the page was last updated. but whenever I refresh the page, it shows the current time, not the time the page was last updated.

why can this be happening?

thank you.

-------

<script language="javascript">
<!--
var lastModified = document.lastModified;
document.write("This page was last updated " + lastModified);
// -->
</script>

PauletteB
11-01-2002, 02:47 AM
One explanation (http://www.xs4all.nl/~ppk/js/lastmod.html)

In brief:

In order for this property to work, the server has to send the information to the browser.

When a server does not send a lastModified date, Netscape and Opera give a last modification date of 01/01/1970 at 00:00:00 hrs (the start of Epoch Time), while Explorer gives the current time and date.