[Rt-devel] RT 3.6.4rc2

Ruslan Zakirov ruz at bestpractical.com
Fri Jun 15 09:54:24 EDT 2007


On 6/15/07, Nicholas Clark <nick at ccl4.org> wrote:
> > > -----Original Message-----
> > > From: rt-devel-bounces at lists.bestpractical.com [mailto:rt-devel-
> > > bounces at lists.bestpractical.com] On Behalf Of Jesse Vincent
> > > Sent: Friday, June 15, 2007 7:53 AM
>
> > > Fascinating.
> > >
> > > TZ=GMT perl -e' print localtime()."\n"; $ENV{TZ} = "US/Eastern";
> > > print localtime()."\n";'
> > >
> > > Mac OS X:
> > >
> > > Fri Jun 15 12:50:55 2007
> > > Fri Jun 15 08:50:55 2007
> > >
> > >
> > > Linux:
> > >
> > > Fri Jun 15 12:51:51 2007
> > > Fri Jun 15 12:51:51 2007
> > >
> > > Both 5.8.8.
> > >
> > > I wonder what bit of cleverness I'm missing.
>
> On Fri, Jun 15, 2007 at 07:59:56AM -0500, Kelly F. Hickel wrote:
> > Hmm, the obvious combinations work for me on centos 5.5.....
> >
> > [root at starbug2 ~]# TZ=GMT perl -e' print localtime()."\n";'
> > Fri Jun 15 12:58:10 2007
> > [root at starbug2 ~]# TZ="US/Eastern" perl -e' print localtime()."\n";'
> > Fri Jun 15 08:58:21 2007
> > [root at starbug2 ~]# perl  -e' $ENV{TZ} = "GMT"; print localtime()."\n";'
> > Fri Jun 15 12:59:08 2007
> > [root at starbug2 ~]# perl  -e' $ENV{TZ} = "US/Eastern"; print
> > localtime()."\n";'
> > Fri Jun 15 08:59:15 2007
>
> There appear to be two things interacting here (at least in Jesse's example)
[snip]

> so TZ is getting ignored.
>
> 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.
Gentoo linux (Europe/Moscow is default):
$ TZ=US/Mountain perl -we' print localtime()."\n"; $ENV{TZ} =
"US/Eastern"; print localtime()."\n";'
Fri Jun 15 07:44:55 2007
Fri Jun 15 09:44:55 2007
$ TZ=US/Eastern perl -we' print localtime()."\n"; $ENV{TZ} =
"US/Mountain"; print localtime()."\n";'
Fri Jun 15 09:45:09 2007
Fri Jun 15 07:45:09 2007

So not only MacOS is doing something special.

>
> 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.
>
[snip]

>
> And no, I don't know more than this.
>
> Nicholas Clark


-- 
Best regards, Ruslan.


More information about the Rt-devel mailing list