Skip to Main Content
Webmaster in a Nutshell, Third Edition
book

Webmaster in a Nutshell, Third Edition

by Robert Eckstein, Stephen Spainhour
December 2002
Intermediate to advanced content levelIntermediate to advanced
576 pages
32h
English
O'Reilly Media, Inc.
Content preview from Webmaster in a Nutshell, Third Edition

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

%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

01

%D

Date as %m/%d/%y

06/23/95

%e

Date

1 (not 01)

%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

09:21:13 PM

%S

Seconds

09

%T

24-hour time as %H:%M:%S

12:22:40

%U

Week of the year (also %W)

37

%w

Day of the week number (starting with Sunday=0)

2

%y

Year of the century

96

%Y

Year

1996

%Z

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
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Webmaster in a Nutshell, Second Edition

Webmaster in a Nutshell, Second Edition

Stephen Spainhour, Robert Eckstein

Publisher Resources

ISBN: 0596003579Purchase bookErrata Page