[Rt-devel] RT 3.6.4rc2

Sven Sternberger sven.sternberger at desy.de
Sat Jun 16 06:44:29 EDT 2007


Hello!

here my 2c

my test: 

perl -we'print localtime()."\n";$ENV{TZ} = "Europe/London"; print
localtime()."\n";'

Solaris 10: different
Ubuntu 6.04: equal
SL4.4 (RHEL4): different
Suse8.2: different
Debian Sarge: equal

So because I find it funy I googled and found this one:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=48184
http://www.gnu.org/software/libc/FAQ.html#s-4.3

So for me it looks like TZ change is ignored in an running process 
context (you can see this also with strace).

regards!

sven

On Fri, 2007-06-15 at 16:22 +0200, Rolf Grossmann wrote:
> Hi,
> 
> Nicholas Clark wrote:
> 
> > There appear to be two things interacting here (at least in Jesse's example)
> > 
> > On a FreeBSD machine that's in GMT I see:
> > 
> > $ TZ=US/Mountain perl -we' print localtime()."\n"; $ENV{TZ} = "US/Eastern"; print localtime()."\n";'
> > Fri Jun 15 13:31:51 2007
> > Fri Jun 15 13:31:51 2007
> > $ TZ=US/Eastern perl -we' print localtime()."\n"; $ENV{TZ} = "US/Mountain"; print localtime()."\n";'
> > Fri Jun 15 13:31:54 2007
> > Fri Jun 15 13:31:54 2007
> > 
> > 
> > so TZ is getting ignored.
> 
> That is because FreeBSD doesn't have definitions for US/* timezones. If 
> you use e.g. perl -e' print localtime()."\n"; $ENV{TZ} = 
> "America/New_York"; print localtime()."\n";'
> I (being in Germany) get:
> 
> Fri Jun 15 16:13:30 2007
> Fri Jun 15 10:13:30 2007
> 
> Note there is no caching of the TZ variable (I have perl 5.8.7).
> 
> > Whereas an Ubuntu machine recognises the TZ strings:
> > 
> > $ TZ=US/Eastern perl -we' print localtime()."\n"; $ENV{TZ} = "US/Mountain"; print localtime()."\n";'
> > Fri Jun 15 09:32:56 2007
> > Fri Jun 15 09:32:56 2007
>  > $ TZ=US/Mountain perl -we' print localtime()."\n"; $ENV{TZ} = 
> "US/Eastern"; print localtime()."\n";'
>  > Fri Jun 15 07:33:00 2007
>  > Fri Jun 15 07:33:00 2007
>  >
>  > then both print out that timezone at initialisation time, and the 
> subsequent
>  > change is ignored.
> 
> Those results (like the original requestor seems to be getting) on the 
> other hand look very strange to me. Apparently the TZ is being cached.
> 
> > So OS X must be doing something "special" and resetting the timezone for every
> > call to localtime. Note that GMT isn't a great one to test with, as the
> > default for timezones you don't understand is 0, which is GMT.
> 
> I'm inclined to say Linux is doing something special/weird by caching 
> the TZ value.
> 
> > And no, I don't know more than this.
> 
> Me neither. Nor do I have a Linux box available to look for the cause.
> 
> Bye, Rolf.
> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel



More information about the Rt-devel mailing list