SSI Variables:

Environment Variable Description
DOCUMENT_NAME The current file
DOCUMENT_URI Virtual path to the file
QUERY_STRING_UNESCAPED Undecoded query string with all shell metacharacters escaped with "\"
DATE_LOCAL Current date and time in the local time zone
DATE_GMT Current date and time in GMT
LAST_MODIFIED Last modification date and time for current file

CGI Variables:

Environment Variable Description
GATEWAY_INTERFACE The revision of the Common Gateway Interface that the server uses.
SERVER_NAME The server's hostname or IP address.
SERVER_SOFTWARE The name and version of the server software that is answering the client request.
SERVER_PROTOCOL The name and revision of the information protocol the request came in with.
SERVER_PORT The port number of the host on which the server is running.
REQUEST_METHOD The method with which the information request was issued.
PATH_INFO Extra path information passed to a CGI program.
PATH_TRANSLATED The translated version of the path given by the variable PATH_INFO.
SCRIPT_NAME The virtual path (e.g., /cgi-bin/program.pl) of the script being executed.
DOCUMENT_ROOT The directory from which Web documents are served.
QUERY_STRING The query information passed to the program. It is appended to the URL with a "?".
REMOTE_HOST The remote hostname of the user making the request.
REMOTE_ADDR The remote IP address of the user making the request.
AUTH_TYPE The authentication method used to validate a user.
REMOTE_USER The authenticated name of the user.
REMOTE_IDENT The user making the request. This variable will only be set if NCSA IdentityCheck flag is enabled, and the client machine supports the RFC 931 identification scheme (ident daemon).
CONTENT_TYPE The MIME type of the query data, such as "text/html".
CONTENT_LENGTH The length of the data (in bytes or the number of characters) passed to the CGI program through standard input.
HTTP_FROM The email address of the user making the request. Most browsers do not support this variable.
HTTP_ACCEPT A list of the MIME types that the client can accept.
HTTP_USER_AGENT The browser the client is using to issue the request.
HTTP_REFERER The URL of the document that the client points to before accessing the CGI program.

SSI Date/Time Formating:

Format Value Example
%a Day of the week abbreviation Sun
%A Day of the week Sunday
%b Month name abbreviation (see %h) Jan
%B Month name January
%d Date 01 (not 1)
%D Date as "%m/%d/%y" 06/23/95
%e Date 1
%H 24-hour clock hour 13
%I 12-hour clock hour 01
%j Decimal day of the year 360
%m Month number 11
%M Minutes 08
%p AM | PM AM
%r Time as "%I:%M:%S %p" 07:17:39 PM
%S Seconds 09
%T 24-hour time as "%H:%M:%S" 16:55:15
%U Week of the year (also %W) 49
%w Day of the week number 5
%y Year of the century 95
%Y Year 1995
%Z Time zone EST

Sources:

CGI Variables: http://www.oreilly.com/openbook/cgi/ch02_02.html#CGI-CHP-2-TBL-1
SSI Variables: http://www.oreilly.com/openbook/cgi/ch05_03.html#CGI-CHP-5-TBL-2
SSI Time Formats: http://www.oreilly.com/openbook/cgi/ch05_08.html#CGI-CHP-5-TBL-3