Re: Date Last Modified

by Peter-Paul Koch <ppk(at)xs4all.nl>

 Date:  Thu, 13 Jul 2000 21:59:14 +0200
 To:  datachem(at)shadow.net,
hwg-languages(at)hwg.org
  todo: View Thread, Original
>I use the following javascript to tell when the webpage was last modified:
>
><SCRIPT type="text/javaScript">
><!---
>document.write("This page was last modified: ")
>document.write (document.lastModified);
>// --->
></SCRIPT>
>
>Everything seems to be satisfactory but today I received a  message from an
>user that the webpage indicated that it was last updated on 12-31-1969.

My guess: The user has Netscape (or Opera) and your server is old. I'm not
entirely sure what the problem is, but Netscape has problems with the
lastModified dates from some server. I tested this on an old NCSA server
and Netscape didn't understand the date, so it gives 01/01/1970 00:00:00.
It could be an hour earlier because of daylight saving time (31/12/1969
23:00:00).

There's nothing you can do about it without long and complicated scripts
that check (for instance) if the lastModified was in 1970, if so ignore it.

I just finished researching document.lastModified and especially in
Netscape the implementation is a bloody mess. See (once again)
http://www.xs4all.nl/~ppk/js under Date and Time => Last Modified.

ppk

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA