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, and it takes a number of special values that are summarized in the table below.
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 would produce output such as:
The file address.html was last modified on: 12/23/95 07:17:39 PM
Status Code | Meaning | Example |
---|---|---|
%a
| Day of the week abbreviation | Sun |
%A
| Day of the week | Sunday |
%b
| Month name abbreviation (also %h )
| Jan |
%B
| Month name | January |
%d
| Date | |
%D
| Date as "%m/%d/%y "
| /23/95 |
%e
| Date | (not 01) |
%H
| -hour clock hour | |
%I
| -hour clock hour | |
%j
| Decimal day of the year | |
%m
| Month number | |
%M
| Minutes | |
%p
| AM | PM | AM |
%r
| Time as "%I:%M:%S %p "
| PM |
%S
| Seconds | |
%T
| -hour time as "%H:%M:%S "
| :22:40 |
%U
| Week of the year (also %W )
| |
%w
| Day of the week number | |
(starting with Sunday=0) | ||
%y
| Year of the century | |
%Y
| Year | |
%Z
| Time zone | EST |