Configurable Time Formats for SSI Output
Among its functions, the
config
SSI command allows you to specify the way
the time and date are displayed with the timefmt
argument. It takes a number of special values that are summarized in
Table 13-1.
Table 13-1. SSI time formats
Status code |
Meaning |
Example |
---|---|---|
|
Day of the week abbreviation |
Sun |
|
Day of the week |
Sunday |
|
Month name abbreviation (also |
Jan |
|
Month name |
January |
|
Date |
01 |
|
Date as |
06/23/95 |
|
Date |
1 (not 01) |
|
24-hour clock hour |
13 |
|
12-hour clock hour |
01 |
|
Decimal day of the year |
360 |
|
Month number |
11 |
|
Minutes |
08 |
|
AM | PM |
AM |
|
Time as |
09:21:13 PM |
|
Seconds |
09 |
|
24-hour time as |
12:22:40 |
|
Week of the year (also |
37 |
|
Day of the week number (starting with Sunday=0) |
2 |
|
Year of the century |
96 |
|
Year |
1996 |
|
Time zone |
EST |
The
config
command in the following example makes use
of two of those special time values:
<!--#config timefmt="%D %r" --> The file address.html was last modified on: <!--#flastmod file="address.html"-->.
where %D
specifies that the date appear in
“mm/dd/yy” format, and
%r
specifies that the time appear as
“hh/mm/ss AM|PM”.
Thus the previous example produces output such as:
The file address.html was last modified on: 12/23/95 07:17:39 PM
Get Webmaster in a Nutshell, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.