DeveloperBarn Forums

DeveloperBarn

Programming & IT forum

Date Last Modified for ASP Pages

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, ...

Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development > ASP Code Samples

  #1  
Old March 21st, 2008, 12:20 PM
mehere's Avatar
Super Sarcasm Mistress
 
Join Date: Mar 2008
Real name: Joanne
Location: Wide Awake In Dreamland
Posts: 375
Rep Power: 6
mehere is just really nicemehere is just really nicemehere is just really nicemehere is just really nicemehere is just really nice
Default Date Last Modified for ASP Pages

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
%>
then to use on your page, just add the following line where you want it to display
Code:
This page last modified on: <%=lastModified()%>

Comments on this post
BLaaaaaaaaaarche agrees:
__________________
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.
Reply With Quote
Reply

  DeveloperBarn Forums > Programming & Scripting > ASP Development > ASP Code Samples

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

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


All times are GMT -4. The time now is 02:41 AM.


Copyright ©2008-2010, DeveloperBarn

Content Relevant URLs by vBSEO 3.3.2