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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page Last Modified Date in ASP

Status
Not open for further replies.

RottPaws

Programmer
Mar 1, 2002
478
US
I tried adding a javascript line to the bottom of an asp page to show the last time the page was modified, but it just shows the current date/time.

I assume this is because the page is generated dynamically by the server and is ineffect modified each time it is displayed.

Is there any ASP equivalent to the javascript document.lastModified property? _________
Rott Paws

...It's not a bug. It's an undocumented feature!!!
 
Try...
<%
file = Request.ServerVariables(&quot;PATH_TRANSLATED&quot;)
Set fs = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set f = fs.GetFile(file)
LastModified = f.datelastmodified
response.write FormatDateTime(LastModified, 0)

Set f = Nothing
Set fs = Nothing
%>
Saturday 12.00
im6.gif
im2.gif
im2.gif
20.00
im5.gif
im4.gif
im7.gif
3.00am
im8.gif
Sunday [img http
 
Perfect. Thanks a bunch! _________
Rott Paws

...It's not a bug. It's an undocumented feature!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top