Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Web
Expertise: All
Aug 14, 1999



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Dynamically Display the Last Modified Date

A lot of Web pages have a last modified date at the bottom of the page. Although this is a feature easily managed by changing the HTML, a better approach would to generate the last modified date dynamically through ASP.

The key is to extract this information from your file system. First, use the "PATH_TRANSLATED" Request variable to retrieve the physical path of the file on your server. Then, using the FileSystemObject, you can get the last modified date from the file system. Finally, convert the general date time format to the format of your choice.

Dim szPath
Dim fso
SzPath = Request.ServerVariables("PATH_TRANSLATED")
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Response.Write "Last Modified Date: " _
& FormatDateTime(fso.GetFile(szPath).DateLastModified,1)
William Wen
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date