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 |