XSSI Library

On This Page

Information about the <TT>timefmt</TT> command.

timefmt Commands Introduction

The key to working with anything that deals with the date or the time when using an SSI is the timefmt string. I have included two charts that list the commands that used in the string. One chart is in Alphebetical order. Another one is sorted by functional groupings.

What's a command string?
The timefmt command string tells Apache how to present the current date and time. To do this, we use the command:

<!--#config timefmt = "command_string" -->

Where you see command_string is you will need to put your string of commands. Let's play with one of the commands: %A. This command tell Apache to present only the name of the current day of the week. (Yes, the capitalization does matter!)

So now we have a command that we can put into our HTML page:

<!--#config timefmt = "%A" -->

Once you have your command string decided on, it's a good idea to test it out to make sure it's dong what you want. The easiest way to do this is add

<!--#echo var="DATE_LOCAL" -->

after your config timefmt command. (If you don't know what "DATE_LOCAL" means, check out the reference for Environment Variables.)

How do we know it worked?
Now let's put together a sample page that will show us what we've got so far:


<!--#config timefmt = "%A" -->
Today is <!--#echo var="DATE_LOCAL" -->


Once you've got this page set up on your server correctly, you should get a page that should say "Today is Saturday". That's a good start but we should get some more details, don't you think?

To Page Two


A printer-friendly version of this article is available.
This site hand-coded for your protection.