Penn State Homepage

Teaching and Learning with Technology

Creating Accessible Web Sites

Auto Datestamps without Javascript

This Page

  1. Problems with JavaScript
  2. Dreamweaver Insert Date
  3. Front Page Timestamp Bot
  4. Server Side Incude

Problems with JavaScript

One feature that Webmasters like to use are dates which update themselves as new versions of a page are created or uploaded. If this is done with Javascript, then you would need to include a NOSCRIPT tag in which you would update the date manually - thus defeating the purpose of the script!

Below are several options in which you can insert a date which updates itself without Javascript. All these options add special tags as HTML comments which allows the date to be updated by the editor or by the server.

Top of Page

Dreamweaver Insert Date

Dreamweaver allows you to insert a date in a format which updates itself everytime you save the file in Dreamweaver.

To Insert the Date

  1. Go the the Insert menu and select Date (or choose the calendar icon in the Common tab of the toolbar).
  2. In the pop-up window, select the desired format and check the option for "Update automatically on save."
  3. Save the document and the current date will be displayed. See the example below.

Dreamweaver Auto Date (in military style time)

This file was last saved on - August 8, 2005 15:30

View the Code (Date is not updated)

<!-- #BeginDate format:Am1m -- >February 25, 2004 16:40 <!-- #EndDate -- >

 

Top of Page

Front Page Timestamp Bot

This is similar to Dreamweaver, except that the code inserted is called a Front Page Webbot.

To Insert the Date

  1. Go the the Insert menu and select Date and Time.
  2. In the pop-up window, select the desired format and check the option for "Date this page was last edited."
  3. Save the document and the current date will be displayed. See the example below.

Web Bot (in military style time)

This file was last saved on - 02/25/2004 04:23:45 PM -0500

View the Code (Date is not updated)

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%m/%d/%Y %I:%M:%S %p %Z" startspan -- >
02/25/2004 04:23:45 PM -0500
< !--webbot bot="Timestamp" endspan i-checksum="38424" -- > </p >

 

Top of Page

Server Side Include (S.S.I.)

You can include a snippet of code which instructs the server to change the date everytime you upload the file. To do that:

  1. Write <!--#echo var="LAST_MODIFIED"-- > wherever you want a date to appear.

  2. Save your file with the .shtml extension to indicate that a server needs to parse a server side include.
    NOTE: Some servers support this extension even if the file type is .html. Test your page or check with your administrator for details. See also the Penn State Personal Home Page Help for setting up SSI support within .html files in your own directory.

Server Side Include

This file was last uploaded on - Monday, 08-Aug-2005 16:12:28 EDT

View the Code (Date is not updated)

This file was last uploaded on - <!--#echo var="LAST_MODIFIED"-- >

Note: When the page is actually downloaded by a user, the SSI statement is replaced by the date.

 

 

Top of Page

Site Menu: Home Page/Main Menu | Section 508 Guidelines | Quick Checklist | Details by Tag
| Links | I.T.S. Seminar Page | Sitemap


©1999-2006 Pennsylvania State University.

This Web page is hosted by (by Teaching and Learning with Technology, a unit of Information Technology Services. Please contact the Webmaster if you have any questions.

Last Update: Monday, 08-Aug-2005 16:12:28 EDT