Last modified date When was a file changed?

' If sFile = "" Then current file is used 
' ( the file that includes this file )
' Else it is assumed that it is a full path

Function File_GetLastModified( sFile )
	Dim objFileObj, objFile
	
	Set objFileObj = CreateObject("Scripting.FileSystemObject")
  	If sFile = "" Then
  		sFile = Server.MapPath( Request.ServerVariables("SCRIPT_NAME") )
  	End If
  	
  	Set objFile = objFileObj.GetFile(sFile)

  	File_GetLastModified = objFile.DateLastModified
End Function



Response.Write "c:\test.txt was modified:" & File_GetLastModified("c:\test.txt")
Response.Write "This file is modified:" & File_GetLastModified("")


Information and tips