Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lastModified

Status
Not open for further replies.

jleampark

Technical User
Mar 4, 2005
7
US
I want to put a note on my pages to show the last time the page was updated. I googled it and found:

<script type="text/javascript" language="JavaScript">
document.write(document.lastModified)
</script></p>

However, this only seems to show the last time the page was loaded into the browser. For instance, I added this script two days ago and it read, "Last updated on Wednesday, May 28, 2008."

No changes have been made since then.

Today, it reads "Last updated on Friday, May 30, 2008"

I did have the time showing as well and, each time I refreshed the page, the time would update.

Is there an easy was to show the past time a page was changed and uploaded to the server?

Thanks!

Joe
 
It's possible your web server is always giving the "last modified" header as "now" instead of the actual last modified time.

I imagine that JS is just passing this through to you, so I'd investigate your web server setup.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
you might have to grab the actual file of the page (like: my_page.asp) and look at the lastmodified date of that file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top