SSI Environment Variables
Time Format
The default formatting used for the DATE_LOCAL and DATE_GMT environment variables is defined on your web server. You can override this behavior in a couple of ways.
The simplest way is to use the <!--#config command before you call the chosen <!--#echo var="DATE ... command. To override the server default format in a web page, use the following commands:
<!--#config timefmt=formatstring
-->
<!--#echo var="DATE_LOCAL" --> (or
var="DATE_GMT" if desired)
The formatstring uses the following variables to define the date/time value and formatstring should be of the form
"%A, %d-%b-%Y %H:%M:%S %Z"
would return
Monday, 18-Aug-2025 14:43:59 CDT
NOTE: One thing I have noticed on my server, is that changes to the time format using this command are in essence changes to the default and will affect all date/time strings displayed after the format command, or until another format command is issued.
Another interesting note comes from studying the FrontPage Save Results Component that is used on forms. Note that the webbot code includes these two lines which obviously use the same codes in the format strings:
S-Date-Format="%A, %B %d, %Y"
S-Time-Format="%I:%M %p"
Another way according to Apache.org, is beginning with Apache Server Software version 2.0.30 and later, the following command can be added to your .htaccess file to change the default format for your entire web.
SSITimeFormat "%A, %d-%b-%Y %H:%M:%S %Z"
|
|