I think that http://www.freebsd.org/cgi/query-pr.cgi?pr=23323
will be interesting for you.
----- Original Message -----
From: Gil Rudge <email@example.com>
Sent: Tuesday, May 29, 2001 6:09 PM
Subject: Problem with the time zone in version 4.3
> I encountered a small problem while changing the time zone.
> I have a process (process A) that starts when the machine is booted and
> for requests.
> In another process I changed the time zone. When running date (from any
> terminal) I get the time with the newly changed time zone, but in process
> when I read the tm struct I still read the old time zone.
> In process A, I read the tm struct by using:
> time_t tval;
> struct tm *ltm = localtime(&tval);
> Note that I made a small exe that ran the same lines of code as above,
> ran it I also read the correct time, from any terminal.
> I found out that if I preceded the calls above with this code bellow,I get
> correct time zone. Note that the same code without the set or unset calls
> not work either.
> setenv("TZ", ":/etc/localtime", 1);
> I would like to know the reason for this phenomena, and is there a better
> to solve it ?
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message