MikroSight.com

MikroSight.com

| Home | NPA/NPX |

Google
Web
MikroSight

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"

  • %A full weekday name (localized) 

  • %a 3-character weekday (localized) 

  • %B full month name (localized) 

  • %b 3-character month (localized) 

  • %c date and time (localized) 

  • %d 2-digit day of month 

  • %H 2-digit hour (24 hour clock) 

  • %I 2-digit hour (12 hour clock) 

  • %j 3-digit day of year 

  • %M 2-digit minute 

  • %m 2-digit month

  • %p am/pm of 12 hour clock (localized) 

  • %S 2-digit second 

  • %U 2-digit week of year (Sun 1st DOW)

  • %W 2-digit week of year (Mon 1st DOW) 

  • %w 1-digit weekday (Sun 1st DOW) 

  • %X time (localized) 

  • %x date (localized) 

  • %Y 4-digit year 

  • %y 2-digit year 

  • %Z time zone name 

  • %% literal `%'