>My boss would like the output of ssi commands to be in CST.  All I
>could find was  the ability to change the format of the time, not the
>timezone.
>
>I could use this:
>
><!--#config timefmt="" -->
>
>but not something like this:
>
><!--#config timefmt="timezone"  tz="CST"-->
>
>to thus display in CST and not MST.


i know this will work, because i've tested it on my own server:

    <!--#exec cmd="TZ=US/Central ; export TZ ; date" -->

and you can use the same '%m/%d/%y %H:%M:%S' literal substitutions you'd
find in a normal date string.

theoretically, you should be able to do the same thing, without needing
exec permissions, with the directives:


    <!--#set var="TZ" value="US/Central" -->
    <!--#config timefmt="[whatever]" -->
    <!--#echo var="DATE_LOCAL" -->


but it doesn't work.


as for the whys behind the whole thing, it gets a bit involved.. unix
systems work with the general assumption that the hardware clock will be
set to GMT, and that every user will have their own timezone identified by
the variable 'TZ' in their login environment.   that variable points to a
file which contains all the information the standard time-handling routines
need to convert the bit vector in the clock to a human-readable time value
for the appropriate time zone.

the problem with trying to change the timezone for a webserver is that
there's no unique, single-user session whose 'TZ' value is being changed.
to get that type of session, you have to exec a shell, and set the value in
that.

to make things even more funky, shells keep two lists of variables in their
environments.. all of the values are effective in the current shell, but
some of them are 'contagious'.. they get included in the environments of
any sub-shells and commands which are executed from that shell.   for
safety's sake, variables remain local to the current shell by default.   to
make them available to subsequent commands, you have to tell the shell to
do so explicitly.. hence the need for the 'export' statement.


Apache runs by spawning off several clones of itself, which do the actual
work of finding pages, running scripts, and passing the output back to the
user.   each of those child processes has its own set of environment
variables, and remains active for quite some time.. usually several hundred
page requests.   if it were possible to export variables to the environment
of a clone, which actually handles the procssing of an SSI, it would be
possible to carry information over from one request to another.   to quote
Rich:  That Would Be Bad..










mike stone  <[EMAIL PROTECTED]>   'net geek..
been there, done that,  have network, will travel.



____________________________________________________________________
--------------------------------------------------------------------
 Join The Web Consultants Association :  Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------

Reply via email to