How to get last updated & created date and time of an ASP fileWe will try to develop a code for showing the last modified date and the created date of the file and display to visitors. This code has to work on it own without any input or changed settings.
We will use the FileSystemObject for getting the last changed or updated along with created date of the file. To make this code universal we will not use name of the file as input to this FileSystemObject , it its place we will use code to get the current file name and then use that as input to FileSystemObject. This way we can make it independent of file name setting and the same code can be used inside any asp file without any changes.
Before reading this it is advisable to read the FileSystemObject and how to get the file name of the current script running page. With this knowledge we can add more code to get the last updated time of the file.
Here is the code to get the current file name and FileSystemObject created.
Dim objFSO, objFile, fname, fullname, my_array
To these lines we will add the file name and DateCreated and DateLastModified to get the full code to display the modified time.