April 7th, 2003, 05:56 PM
How to add "Last updated"???
Is there any way to add a automatically date/time when a page/script was last updated? The page is not driven on a db.
April 7th, 2003, 06:39 PM
The only problem with this is that you will need to put this code on every page. If you placed it all in an include file and then had it look up the size of Server.Variable("SCRIPT_NAME") that would return the date of the include file I would think.
Maybe a better way would be to place it all in a function with a parameter for the page name, then place the function in an include file. Here is my version of the code, I didn't test it sorry. Hopefully it works or if not you can re post and I'll correct my mistakes
' 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(page))
' Get last modified property
LastModDate = objFile.DateLastModified
' Kill our objects
Set objFile = Nothing
Set objFSO = Nothing