Last Modified Time Stamp

When was this file last modified? Assuming the name of this file is myPage.asp, this is how you would do it:
<%
 ' Set your objects here:
 Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
 Set objFile = objFSO.GetFile(Server.MapPath("myPage.asp"))
 dateModified = objFile.DateLastModified
 %>
 

 Then, show the stuff on your page:
 This file was modified on the date and time below:<br>
 You can write out the date as is:<br>
 <%=dateModified%><br>
 or special format it:<br>
 <%=FormatDateTime(dateModified,1)%> at <%=FormatDateTime(dateModified,3)%><br>
 <%
 ' don't forget to kill your objects!
 Set objFile = Nothing
 Set objFSO = Nothing
 %>

Example

This file was modified on the date and time below:
You can write out the date as is:
10/22/2025 11:20:30 AM
or special format it:
Wednesday, October 22, 2025 at 11:20:30 AM


fso last modified file system object


Back To Top
© 1998 - 2025 psacake.com
Version 8.13 | Advertise on this site