SSI:The Config Directive
This directive influences the way the server outputs text when processing certain SSI commands. argument can take one of the following values
- errmsg - This directive is used to assign the error message that is output when an SSI command cannot be correctly interpreted by the server. For example, <!--#config errmsg="<div class='serr'>SSI Error</div>" -->. The, nonexistent, SSI directive <!--#xyz --> would result in the message SSI Error.
- sizefmt - Use this directive to indicate the manner in which file sizes should be reported. The default value of "abbrev" causes file sizes to be output in kilobytes or megabytes. The assignment <!--#config sizefmt="bytes" --> will result in the file size being reported in bytes. The size of this document is 4,944 bytes.
- timefmt - Use this directive to determine the format for date and time output. The range of options that work with Apache are listed below.
| Code | Function | Code | Function |
|---|---|---|---|
| %a | Abbreviated day name | %A | Full day name |
| %b | Abbreviated month name | %B | Full month name |
| %c | Locale date-time format | %d | Day of month - 01 to 31 |
| %D | Shortcut for %m/%d/%y | %e | Day of month - 1 to 31 |
| %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 | Newline character |
| %p | AM/PM string | %r | Shortcut for %I:%M:%S %p |
| %R | Shortcut for %H:%M | %s | Seconds since January 1, 1970 |
| %S | Second - 00 to 59 | %t | Tab character |
| %T | Shortcut for %H:%M:%S | %w | Day of week - 00 to 06 |
| %W | Week of year - 00 to 53 | %y | Year - 00 to 99 |
| %Y | Year with century | %Z | Timezone name |
A few examples are given below
| Format | Output |
|---|---|
| %A, %erd %B %Y | Saturday, 4rd of February 2012 |
| %T | 13:27:37 |
| %wth day of the %Wth week of %Y | 6th day of the 05th week of 2012 |
You will note that the result of using these formats is not always perfect. For instance, while the 3rd of October is correct, 20rd of October is wrong. SSI conditionals can be used to handle such issues.