Re: [nslu2-linux] Problem with date and timezones in uNSLUng
- olangelsa wrote:
> Dear NSLU community,There are two ways that a timezone is most often set. One means is to have the
> I have a question that I am hoping you can help me with.
> When I manually run "date" in the terminal (ssh) of my NSLU, the time
> is displayed using the correct timezone, that is CEST. But when I
> call "date" from a .cgi script, the time is displayed using another
> timezone, UTC.
> Does anybody know how I could correct this matter, so that output of
> date would be using the CEST timezone, regardless of how "date" is
file /etc/localtime contain the timezone data for the correct timezone (this can
be done by copying in the file, but is often done by having /etc/localtime be a
symbolic link to the timezone file:
/etc/localtime -> /usr/share/zoneinfo/America/Chicago
The other means is to set an environment variable named "TZ" to a
specially-coded string that represents the timezone. Usually this value is the
timezone name and it's offset from UTC, but it can also be extended to encode
daylight savings time.
These mechanisms are used by the system libraries, and should be common to all
normal commands and scripting languages. So I would suspect that perhaps you
have set the TZ environment variable in your login environment, and it is not
picked up by the CGI script. Try setting the variable in the CGI script as well.
> Thanks in advance.Mike (mwester)