Click to See Complete Forum and Search --> : Last Updated script problem


vulcanchic
11-25-2003, 08:46 PM
I'm using a last updated script on two different sites, but it's only working right on one site. I'm using the exact same script on both sites though. On the second site, the date changes every day, regardless of when the page was updated. Why is it doing that? Here's the script:

<script language="Javascript"><!--
var dateModified = document.lastModified;
mydate = dateModified.slice(0,10);
document.write("Last updated: " + mydate + "&nbsp;&nbsp;");
//-->
</script>

Thanks!

gil davis
11-25-2003, 08:58 PM
Some sites do not support date.lastModified, so they report all zeros. Microsoft, in their infinite wisdom, decided that was bad, so if IE sees all zeros, it replaces that with the current date.

I always thought that no answer was better than a lie ...