Script to show the last time the page was updated

 

Contributed by
Rating: 4 stars4 stars4 stars4 stars4 stars / 16
October 31, 1999
Rate this Article:
MEH MEH++


SEARCH ASP FREE
TOOLS YOU CAN USE

advertisement

Display the Last Time that the Page was Modified




Pre-Amble:

Often I get asked the question - How do I display the last time that the page was updated?

This is how you do it:

1. Copy this Function to your Project
2. In your ASP Page type in the following:

This Page was last Modifed on <%=Modified%>

Function Modified()
    Dim objFSO
    Dim objFile
    Dim dateModified
    Dim FileName
    FileName = Request.ServerVariables("Script_Name")
    ' Creates the object and assigns it to our variable.
    Set objFSO =Server.CreateObject("Scripting.FileSystemObject")
    ' Get access to the file
    Set objFile = objFSO.GetFile(Server.MapPath(FileName))
    ' Get last modified property
    dateModified = objFile.DateLastModified
    ' You can format it as you like using the FormatDateTime command
    Modified = FormatDateTime(dateModified, 1) & " at " &FormatDateTime(dateModified, 3)
    ' Kill our objects
    Set objFile = Nothing
    Set objFSO = Nothing
End Function

blog comments powered by Disqus
ASP CODE ARTICLES

- ASP Forms
- ASP: The Beginning
- Getting Remote Files With ASP Continued
- Inbox and Outbox Manipulation in ASP
- Relational DropDownList Using VB.NET
- Ad Tracking URL Hits
- Use ViewState to display one record per page...
- Send Email using ASP.NET formatted in HTML
- ASP File Explorer
- ASP/XML Interview questions by Srivatsan Sri...
- Pressing RETURN won't submit the form
- This shows how you get the TEXT of a combo r...
- Group Data by Adrian Forbes
- Multiple checkbox select sample
- Multiple checkbox select with all values sam...

ASP Web Hosting ASP.Net Web Hosting Windows Web Hosting
 
 
 

ASP Free Forums 
 RSS  Tutorials RSS
 RSS  Forums RSS
 RSS  All Feeds
Site Map 
Request Media Kit
Write For Us Get Paid 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Privacy Policy 
Support 


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 9 - Follow our Sitemap
Most Popular Topics
All ASP.Net Tutorials