Controlling the date-time format for an echo command
When a Web server encounters an echo command requesting a date/time, the result is formatted according to default date/time format of the server. You can change the date/time format by inserting a config command with the timefmt parameter before the relevant echo command. The results of any date-related echo commands located after the config timefmt command in the same document will use the specified date/time format.
To set the date/time format for an echo command
- Place the insertion point anywhere in the current document before the echo command(s) for which you want to set the date/time format.
- On the Custom toolbar, click SSI, and then click Time Format. (If the the SSI command is not visible in the Custom toolbar, add it to the Custom toolbar by selecting Insert from the Categories list and then SSI from the Commands list.)
- Under Time Format, click the date or time format you want to use, or click Custom Format and enter any combination of date/time format codes and separators (see table below).
- Click OK.
If the display of special tag marksTo toggle the display of special tag marks, click Show/Hide Special Tag Marks on the Standard Toolbar. is enabled, an “SSI” box () will appear at the location of the config command.
Date/time format codes
You can enter any combination of the following codes in the Custom Format box to create your own custom date/time format. You can also enter spaces and punctuation marks as separators. (But do not use “%” as a separator.)
Code |
Meaning |
---|---|
%a |
abbreviated weekday name |
%A |
full weekday name |
%b |
abbreviated month name |
%B |
full month name |
%c |
country-specific date/time format |
%C |
default date/time format |
%d |
day of month – 01 to 31 |
%D |
date as %m/%d/%y |
%e |
day of month – 1 to 31 (single digits are preceded by blanks) |
%h |
abbreviated month name (same as %b) |
%H |
hour – 00 to 23 |
%I |
hour – 01 to 12 |
%j |
day of year – 001 to 366 |
%m |
month of year – 01 to 12 |
%M |
minute – 00 to 59 |
%n |
line break |
%p |
AM/PM |
%r |
time as %I:%M:%S %p |
%R |
time as %H:%M |
%S |
second – 00 to 61 |
%t |
tab character |
%T |
time as %H:%M:%S |
%U |
week number (Sunday is the first day of the week) – 00 to 53 |
%w |
day of week (Sunday = 0) |
%W |
week number (Monday is the first day of the week) – 00 to 53 |
%x |
country-specific date format |
%X |
country-specific time format |
%y |
2-digit year – 00 to 99 |
%Y |
4-digit year |
%Z |
time zone |