Sure thing,

If I have the following script: www.somewhere.com/e3/datetz.cgi (where e3 is using PerlRun) that does the following:

 

$ENV{‘TZ’} = ‘US/Eastern’;

POSIX::tzset();

my @time = localtime();

my $time = time();

$ENV{‘TZ’} = ‘US/Pacific’;

POSIX::tzset();

 

# I would expect this to print current time info in the Eastern time zone.

print “$_\n” foreach @time;

print “$time\n”;

 

At this point I would expect the values returned in @time and $time to be in the Eastern timezone.  This works no problem in a non-mod_perl’d environment but not under mod_perl.  Would it be beneficial to put code in a PerlFixUpHandler that sets the time zone data?

 

Thank you for your help,

 

Tyler Fullerton.

 

 


From: Garrett, Philip (MAN-Corporate) [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 03, 2006 11:14 AM
To: Tyler; modperl@perl.apache.org
Subject: RE: Using ENV{'TZ'} in mod_perl

 

Can you post a tiny test script that reproduces your problem?

 


From: Tyler [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 03, 2006 2:06 PM
To: modperl@perl.apache.org; Garrett, Philip (MAN-Corporate)
Subject: RE: Using ENV{'TZ'} in mod_perl

Hello,

I previously requested some help with setting $ENV{TZ} and using it’s value to modify the output of localtime (i.e. Make it time zone specific).  The suggested solution was to use POSIX::tzset() because my perl installation was compiled with thread support.  So this helped, however I’m still not able to use $ENV{TZ} to modify the behavior of localtime in a cgi script.  Is there some sort of limitation with cgi scripts run under mod_perl (specifically: PerlRun) that would prevent this from working?

 

Thank you,

Tyler Fullerton.

 


From: Garrett, Philip (MAN-Corporate) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 20, 2006 11:25 AM
To: Tyler; modperl@perl.apache.org
Subject: RE: Using ENV{'TZ'} in mod_perl

 

If you're using a perl compiled with thread support, you'll need to call POSIX::tzset() after setting $ENV{TZ}.

 

 


From: Tyler [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 20, 2006 2:09 PM
To: modperl@perl.apache.org
Subject: Using ENV{'TZ'} in mod_perl

Hello,


I have a script that use to use the value in the environment variable ENV{‘TZ’} to modify the output of the perl builtin localtime.  In other words, I’d do something like this:

 

$ENV{‘TZ’} = ‘US/Eastern’;

@time = localtime();

 

This use to give me the localtime in whatever timezone was in ENV{‘TZ’}.  However, I have since then switched to using mod_perl (more specifically the PerlRun module) and now this code no longer works (i.e. $ENV{‘TZ’} doesn’t have any affect on localtime).  I’ve tried various modifications to my mod_perl install (such as configuring PerlPassEnv, etc) but still can’t get it to work. 

 

Does anyone have any recommendations, or thoughts?

 

Thank you in advance,

Tyler Fullerton.

 



__________ NOD32 1.1764 (20060920) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com



__________ NOD32 1.1787 (20061002) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com

Reply via email to