Last date website was modified

Hi,

How can I display the last date the site / page was modified?

Regards
barnarpAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

str_kaniCommented:
This one worked for me
<%
Dim oFSO,oFile,dMod
Set oFSO=Server.CreateObject("Scripting.FileSystemObject")
'BE SURE TO CHANGE THE NAME IN THE NEXT LINE!!
Set oFile=oFSO.GetFile(Server.MapPath("test1.asp"))
dMod=oFile.DateLastModified
Set oFSO=Nothing
Set oFile=Nothing
Response.Write dMod
%>

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
str_kaniCommented:
and you can refer this link also for some more option. http://www.asp101.com/samples/modified.asp
barnarpAuthor Commented:
Hi,

The example you provided does not work here. If I include it in my code and run it (IIS 5.0) then  IE says : "Opening page..." and stays there. Nothing happens.

CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

str_kaniCommented:
can you paste your code here....?

i hope you have copied the same code
and saved it as test1.asp and execute ?  or there is a file named test1.asp in the same folder...
<%
Dim oFSO,oFile,dMod
Set oFSO=Server.CreateObject("Scripting.FileSystemObject")
'BE SURE TO CHANGE THE NAME IN THE NEXT LINE!!
Set oFile=oFSO.GetFile(Server.MapPath("test1.asp"))
dMod=oFile.DateLastModified
Set oFSO=Nothing
Set oFile=Nothing
Response.Write dMod
%>
barnarpAuthor Commented:
Same as asp101 code. If I upload the page to my asp and run it from their webserver, it works fine, but locally it hangs.

<%
Dim objFSO
Dim objFile
Dim dateModified

' 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("index.asp"))

' Get last modified property
dateModified = objFile.DateLastModified
%>

Last Modified:
<% = FormatDateTime(dateModified, 1) %> at <%= FormatDateTime(dateModified, 3) %>

<%
' Kill our objects
'Set objFile = Nothing
'Set objFSO = Nothing
%>


barnarpAuthor Commented:
asp should be isp
str_kaniCommented:
Make sure you have the latest vbscript installed on your machine.
barnarpAuthor Commented:
how can I check that?
str_kaniCommented:
<%
response.write "Version "&  ScriptEngineMajorVersion & "." & ScriptEngineMinorVersion
%>
barnarpAuthor Commented:
Version 5.6
str_kaniCommented:
i am also having 5.6 it worked for me.
barnarpAuthor Commented:
Using Windows XP Pro with IIS 5.1. Don't know what else can be wrong.
str_kaniCommented:
fine, me too have the same cofiguration. it works fine for me. Don't know what could be causing the problem for you. Give me more details if you could that will help me find the issue more...
barnarpAuthor Commented:
Thanks, dont worry. Will give the points
str_kaniCommented:
Thanks :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.