Page Content

With JavaScript

Although JavaScript can be used to create accessible content, the code must be constructed so that the output is accessible on a screen reader. See the Scripts page for more information.

If you wish to include an automatic date generator without JavaScript, the following options are available. All these options add special tags as HTML comments that allow the date to be updated by the Web editor, content management system or the server.

"Insert Date" in Dreamweaver

Dreamweaver allows you to insert a date in a format that updates itself every time you save the file.

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 Update automatically on save option.
  3. Save the document and the current date will be displayed. See the example

Dreamweaver Auto Date (in Military-Style Time)

This file was last saved on –

December 14, 2011 12:56

View the Code (Date is not updated)

<!-- #BeginDate format:Am1m -- >December 14, 2011 12:56 <!-- #EndDate
-- >

Server Side Includes (SSIs)

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

  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.

Top of Page