[Rt-devel] RT 3.6.4rc2

Rolf Grossmann rg at progtech.net
Fri Jun 15 10:22:59 EDT 2007


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.


More information about the Rt-devel mailing list