Odilon Redon's smiling spider

Date and Time Formats with SSI.
author: jim.cerny@unh.edu

last modified on Tuesday, 03-Aug-1999 16:45:07 EDT

This is an experiment with date formats.

For all these examples, view the HTML source before parsing to see the SSI directives used. In each of these examples the LAST_MODIFIED date for this file is inserted by use of the SSI "echo" directive. To control the date format make use of the SSI "config" directive to set the "timefmt" attribute, using one or more date codes, as needed. These codes are those used by the Unix "strftime" routine and are not intuitively obvious. See the strftime man page, as taken from RedHat Linux 6.0, for the list of available format codes. Note that case is significant on these codes.

  • The default date format used by SSI contains lots of detail.
    last modified on Tuesday, 03-Aug-1999 16:45:07 EDT of this year.

  • You can format as numeric mm/dd/yy using the "%D" code. The slash separators are included by that code.
    last modified on 08/03/99 .

  • You can format as dd-mmm-yyyy using the "%d" "%b" "%Y" codes. You supply the hyphens.
    last modified on 03-Aug-1999 .

  • You can format as month, dd, yyyy using the "%B" "%d" "%Y" codes. You supply the comma.
    last modified on August 03, 1999 .

  • You can format just day of the year using the "%j" code.
    last modified on day 215 of this year.

  • You can format just week of the year using the "%W" code.
    last modified on week 31 of this year.


Return to Courses page.