PDA

View Full Version : document.lastModified


mpjbrennan
07-15-2002, 05:56 PM
var update = new Date(document.lastModified) does not work for me in Mozilla on Linux (Red Hat 7.1) I get "invalid date" when I try to access update.

No problem with Mozilla in Windows however.

Anyone else observe this behaviour?


patrick

joh6nn
07-15-2002, 06:58 PM
no. i actually use that method on my own page, and i use Mozilla, and i've never had a problem.

jalarie
07-16-2002, 02:43 PM
Some ISP's refuse to send the document.lastModified item believing it to be a security issue. You wind up getting a null value.

Internet Explorer takes this null, uses it as-is in the 'new Date()' function, and displays the CURRENT date and time. If you're checking a page that you've just updated, all looks well. And your visitors believe that you're constantly updating your site.

Netscape takes the null, forces it to be numeric, gets a zero at this point, uses the zero in the 'new Date()' function, and gets 'January 1, 1970, at 00:00 GMT.' Here in the eastern U.S.A. this displays as 'December 31, 1969, 7:00pm.'

WebTV also forces numeric and gets zero, but it adjusts for the timezone before generating a date and gets a real mess because the result is negative.


I'm sorry that I don't know the specifics of Mozilla, but maybe the above will help you understand what may be happening. If your ISP is not sending the information, but someone else's ISP IS sending it, you would get two different results for the same browser.

mpjbrennan
07-16-2002, 05:50 PM
Thanks jalarie - the problem behaviour however happens when I get the page from the local host (I run Apache). Could it be something in my Apache set-up perhaps? Must take a look at the configuration file. I haven't been able to check it out yet on a real website because my Linux PC hasn't yet got a a modem - another task!

patrick