now with added Masterweb and IB Geek Girl

spider web Ecanus•net :: Tutorials


These aren't really full blown tutorials – more quick 'n' dirty guides to doing stuff that might save you some time. Click the links below to see them.

Adding 'date last updated' to your site :: Page 2

...and onto methods 3 and 4 (if you've not been paying attention, you'll find the first two methods on page 1)...

Here we're going to look at four methods for adding a 'last updated' date stamp to your site, using:


If you're on a 'Nix server, you might want to consider the PHP option. This one's only two simple steps...

Step 1: Copy the code below...(remember to change the filename in the first line to your filename)

<? $last_modified = filemtime("yourfile.php");
print("Last Modified ");
print(date("j/m/y", $last_modified));

Step 2: Paste the code where you want your date stamp. This is the result:

Last Modified 21/11/08

(Step 2 ½: Remember, if it isn't already, you'll need to give your file a '.php' rather than '.html' extension.)


And finally...ASP – another "two-stepper"...

Step 1: Create a file called modified.asp and include the following code:

Dim strFileName
Dim dtmLastModified
Dim dtmLastModifiedDate
Dim dtmLastModifiedTime

strFileName = Request.ServerVariables("SCRIPT_NAME")
strFileName = Replace(strFileName, "/", "\")
strFileName = Server.MapPath(strFileName)

Set objFileSystemObject = Server.CreateObject("Scripting.FileSystemObject")

Set objFile = objFileSystemObject.GetFile(strFileName)
dtmLastModified = objFile.DateLastModified
Set objFile = Nothing

Set objFileSystemObject = Nothing

dtmLastModifiedDate = FormatDateTime(dtmLastModified, 1)
dtmLastModifiedTime = FormatDateTime(dtmLastModified, 3)

Response.Write(dtmLastModifiedDate " " & dtmLastModifiedTime)

Step 2: At the place in your page where you want your date stamp, paste the following code (remembering to use the correct path if you've saved your file somewhere else than a folder called 'scripts' in the same directory as your file):

<!--#include virtual="/scripts/modified.asp"-->


Back to Page 1