[WEB4LIB] Netscape lastModified date is 1969!

Thomas Dowling tdowling at ohiolink.edu
Fri Jun 16 16:40:10 EDT 2000


----- Original Message -----
From: "Michael A. Weber" <webermi at alvernia.edu>
To: "Multiple recipients of list" <web4lib at webjunction.org>
Sent: Friday, June 16, 2000 4:09 PM
Subject: [WEB4LIB] Netscape lastModified date is 1969!


> Help!!!
>
> I need a JavaScript Guru!  (Actually JavaScript neophyte would
probably be
> enough!)
>
> I made a page with some simple Javascript code which shows the last
date
> that the page was modified.
>
> See <http://www.alvernia.edu/fac-sb.htm>
>
> The page works perfectly in Explorer.
>
> But in Netscape 4.7 I get a date of:
>  Wednesday, December 31, 1969 19:00:00
>
> What am I doing wrong?
>
> The code is simple enough
>
> <SCRIPT language = "JavaScript">
> <!--
> document.write("Updated: " + document.lastModified)
> file://-->
> </SCRIPT>
>



From
<URL:http://developer.iplanet.com/support/faqs/champions/javascript.html
>:

=========
2.12. Why doesn't document.lastModified work when I put my files on a
web server?

Navigator expects to receive the modification date of a file in the HTTP
response header from the web server. In the case of files that are being
read from a local disk, Navigator is able to get the modification date
from the operating system.

Not all web servers send the modification date along with the file. When
viewing a file with a call to document.lastModified on such a server,
you'll get a meaningless date.
=========

IE seems to default to today's date.  Mozilla m16 picks January 1, 1970
(the start of the Unix universe); Opera shows nothing.  Your script
probably needs to check that the value exists before displaying it.


Thomas Dowling
OhioLINK - Ohio Library and Information Network
tdowling at ohiolink.edu



More information about the Web4lib mailing list