perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tyler MacDonald <tyl...@ActiveState.com>
Subject Re: TZ variable and mod_perl
Date Mon, 31 Oct 2005 18:16:22 GMT
"Balázs Szabó (dLux)" <dlux@dlux.hu> wrote:
> What I did in my module is the following:
> 
> delete $ENV{TZ};
> tzset();
> ($a, $b) = tzname();
> 
> $a should contain the local timezone (according to the documentation of
> the tzset manual), although it is UTC always. What I suspect is that
> when I delete the TZ variable from the environment, it does not really
> delete it.
> 
> How I can make sure that this variable is deleted?

	I had to use Env::C to accomplish this;

sub set_tz_env {
    my($class, $tz) = @_;
    Env::C::setenv('TZ', $tz);
    $ENV{TZ} = $tz;
    POSIX::tzset();
}

	Cheers,
		Tyler


Mime
View raw message