Apache Environment Variables
Please consider switching to our new and improved hosting service: Islandhosting.com
For support call:     778-410-2454

Apache Environment Variables

A variable is an item of information that changes depending on the page being accessed, the time of day, etc. To display the value of a specific variable, simply include the following piece of text in your page:

     <!--#echo var="VARIABLE-NAME" --> 
By replacing the VARIABLE-NAME part with a variable from the following list, you can display some interesting information to your viewers:

DATE_LOCAL
Displays the current local date and time.

DATE_GMT
Displays the current GMT time.

LAST_MODIFIED
This variable will display the date and time that the page was last modified. The time is based on Islandnet's time, and cannot be displayed according to the viewer's time zone.

REMOTE_ADDR
This one displays the IP number of the computer that the viewer is accessing your page from.


Customizing Date Displays

There is a way to make it display the date, time, or both using a different format. To do this you use the config directive.

Note that you only need one config directive per page, even if you display the time/date in multiple locations.

The format string can contain any characters you want, but the following codes will be replaced with key values:

          %%   same as %

          %a   day of week, using  locale's  abbreviated  weekday
               names

          %A   day of week, using locale's full weekday names

          %b
          %h   month, using locale's abbreviated month names

          %B   month, using locale's full month names

          %c   date and time as %x %X

          %C   date and time, in locale's  long-format  date  and
               time representation

          %d   day of month (01-31)

          %D   date as %m/%d/%y

          %e   day of month (1-31; single digits are preceded  by
               a blank)

          %H   hour (00-23)

          %I   hour (00-12)

          %j   day number of year (001-366)

          %k   hour (0-23; single digits are preceded by a blank)

          %l   hour (1-12; single digits are preceded by a blank)

          %m   month number (01-12)

          %M   minute (00-59)

          %n   same as \n

          %p   locale's equivalent of  AM  or  PM,  whichever  is
               appropriate

          %r   time as %I:%M:%S %p

          %R   time as %H:%M

          %S   seconds (00-59)

          %t   same as \t

          %T   time as %H:%M:%S

          %U   week number of year (01-52), Sunday is  the  first
               day of the week

          %w   day of week; Sunday is day 0

          %W   week number of year (01-52), Monday is  the  first
               day of the week

          %x   date, using locale's date format

          %X   time, using locale's time format

          %y   year within century (00-99)

          %Y   year, including century (fore example, 1988)

          %Z   time zone abbreviation

The difference between %U and %W lies in which day is counted as the first day of the week. Week number 01 is the first week with four or more January days in it.