Wright State University home page. Communications and Marketing
Services
Design
Development
Support
Guides and Standards
Accessibility
Forms
Imagery
Policy
Style
Usability
Web Administrators
Access Request
Contact List
Meeting Notes
Web Team

Guides & Standards - Style - Resouces - SSI

Server Side Includes (SSI) are directives or instructions which you can place in your HTML documents to create output of environment variables (e.g., current time, date) and file statistics (e.g., date last modified).

Current Date
To insert the current date in your HTML document you could place the following line in your document:

Today's date is <!--#echo var="DATE_LOCAL"-->.
This produces the output: Today's date is Wednesday, 17-Nov-2004 11:12:45 EST.

GMT
To insert the Greenwich Mean Time place the following line in your document:

The current GMT time is <!--#echo var="DATE_GMT"-->.
This produces the output: The current GMT time is Wednesday, 17-Nov-2004 16:12:45 GMT.

Last Modified
To insert the date your document was last modified:

This document was last modified <!--#echo var="LAST_MODIFIED"-->.
This produces the output: This document was last modified Wednesday, 17-Nov-2004 10:55:56 EST.

Include file - useful if you have information that will be repeated in numerous documents.
To include the contents of another file in your document:

<!--#include file="file_name"-->

Include virtual
Inserts a file from a directory relative to the server root:

<!--#include virtual="/cwis/resources/file_name"-->

Tailoring Time and Date Output
The config command can be used to select the way the date and time are displayed.
For example:

<!--#config timefmt="%a, %D %I:%M%p"-->
This file was last modified on <!--#echo var="LAST_MODIFIED"-->
This produces the output: This file was last modified on Wed, 11/17/04 10:55AM.

The %a specifies the day of week abbreviation. %D specifies that the date should be in the mm/dd/yy format. %I specifies the hour of a 12-hour clock. %M specifies the minutes and %p specifies AM or PM.

You can use the following time formats:

SSI Time Formats
Format Value Example
%a Day of the week abbreviation Sun
%A Day of the week Sunday
%b Month name abbreviation Jan
%B Month name January
%d Date 01
%D Date as mm/dd/yy 01/02/00
%e Date 1
%H 24-hour clock 13
%I 12-hour clock 01
%j Decimal day of the year 360
%m Month number 11
%M Minutes 06
%p AM | PM AM
%r Time as %I:%M:%S%p 06:23:46 PM
%S Seconds 04
%T 24-hour time as %H:%M:%S 14:39:25
%U or %W Week of the year 51
%w Day of the week number 5
%y Year of the century 00
%Y Year 2000
%Z Time Zone EST

SSI directives have the following format: <!--#command parameter="argument"--> where "command" can be any one of the following commands and "argument" is the appropriate "parameter" listed below.

 

SSI Directives
Command Parameter Description
echo var Inserts value of special SSI variables and other environment variables
include   Inserts text of document into current file
  file Pathname relative to current directory
  virtual Virtual path to a document on the server
config timefmt Changes the time format


[ Web Services | Communications & Marketing | WSU Home ]