This is a discussion on Date Last Modified for ASP Pages within the ASP Code Samples forums, part of the ASP Development category; Here's a function to create a date last modified dynamically on your web pages Code: <%function lastModified() Dim strURL, aryURL, ...
| |||||||
|
#1
| ||||
| ||||
| Here's a function to create a date last modified dynamically on your web pages Code: <%function lastModified()
Dim strURL, aryURL, pagename, objRegExp
strURL = Request.ServerVariables("SCRIPT_NAME")
aryURL = Split(strURL, "/", -1, 1)
pagename = aryURL(ubound(aryURL))
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(pagename))
dMod=oFile.DateLastModified
dYear = year(dMod)
dMonth = monthname(month(dMod + 1))
dDay = day(dMod)
Set oFSO=Nothing
Set oFile=Nothing
Response.Write dMonth & " " & dDay & ", " & dYear
end function
%>
Code: This page last modified on: <%=lastModified()%>
__________________ Quote of the Month: Mistakes: It could be that the purpose of your life is only to serve as a warning to others. Questions to Ponder: Why do banks charge you a "non-sufficient funds fee" on money they already know you don't have? iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm") copyright © 2008 sbenj69 Sarchasm: The gulf between the author of sarcastic wit and the person who doesn't get it. |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| access id in 3 frames pages | guddu | JavaScript Programming | 3 | August 26th, 2008 03:06 PM |
| 'Dynamic' Master Pages | Wolffy | .Net Development | 2 | August 13th, 2008 03:27 PM |
| Error Type:Active Server Pages, ASP 0113 (0x80004005) | guddu | ASP Development | 20 | July 11th, 2008 09:44 AM |