To display the current date and time on your page, the following SSI code is used :
Rather long and drawn out result isn't it? No problem, there is an SSI command that will format it to your specs. This SSI code line goes just before the DATE_LOCAL one...
This will "Configure the next SSI code into time format of this value". There are many different values to enter to get the info you want to show...
The slashes, colons, spaces and commas in the timefmt value will be reflected in the resulting answer. They are considered as normal text. The % indicates the next letter represents part of the SSI date string.
Note : spacing is very crucial to having SSI work correctly. There is a space before the ending comment tag. There is also a space between the config SSI and the echo SSI commands.
Some results will vary depending on the server hosting your web page. These are based on the date and time where the host server is located, not yourself. In some cases though, it may turn out your host server is in the same timezone :)
| <!--#echo var="DATE_LOCAL" --> |
Rather long and drawn out result isn't it? No problem, there is an SSI command that will format it to your specs. This SSI code line goes just before the DATE_LOCAL one...
| <!--#config timefmt="value" --> |
This will "Configure the next SSI code into time format of this value". There are many different values to enter to get the info you want to show...
| Value | Description |
|---|---|
| %a | abbreviated weekday name |
| %A | full weekday name |
| %b | abbreviated month name |
| %B | full month name |
| %C | default date and time format |
| %d | day of month - 01 to 31 |
| %D | date as %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 |
| %p | string containing AM or PM |
| %r | time as %I:%M:%S %p |
| %R | time as %H:%M |
| %S | second - 00 to 59 |
| %T | time as %H:%M:%S |
| %y | year within century - 00 to 99 |
| %Y | year as CCYY (4 digits) |
| %Z | timezone name |
The slashes, colons, spaces and commas in the timefmt value will be reflected in the resulting answer. They are considered as normal text. The % indicates the next letter represents part of the SSI date string.
Note : spacing is very crucial to having SSI work correctly. There is a space before the ending comment tag. There is also a space between the config SSI and the echo SSI commands.
Some results will vary depending on the server hosting your web page. These are based on the date and time where the host server is located, not yourself. In some cases though, it may turn out your host server is in the same timezone :)

