[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    RE: Using ENV{'TZ'} in mod_perl
From:       "Garrett, Philip \(MAN-Corporate\)" <Philip.Garrett () manheim ! com>
Date:       2006-09-20 18:25:02
Message-ID: D9C13100F14E4C4795A1E83B125B40350232B5BF () MSCEXCHS02 ! man ! co
[Download RAW message or body]

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


________________________________

	From: Tyler [mailto:tfullert@webmetrics.com] 
	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.

	 


[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:o = 
"urn:schemas-microsoft-com:office:office" xmlns:w = 
"urn:schemas-microsoft-com:office:word"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.5450.4" name=GENERATOR>
<STYLE>@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
	COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
	COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
	COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
	COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
	COLOR: windowtext; FONT-FAMILY: Arial; mso-style-type: personal-compose
}
DIV.Section1 {
	page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=651052418-20092006><FONT face=Arial 
color=#0000ff size=2>If you're using a perl compiled with thread support, you'll 
need to call POSIX::tzset() after setting $ENV{TZ}.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=651052418-20092006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV><BR>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> Tyler [mailto:tfullert@webmetrics.com] 
  <BR><B>Sent:</B> Wednesday, September 20, 2006 2:09 PM<BR><B>To:</B> 
  modperl@perl.apache.org<BR><B>Subject:</B> Using ENV{'TZ'} in 
  mod_perl<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV class=Section1>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hello,<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><BR>I have a script that use to 
  use the value in the environment variable ENV{&#8216;TZ&#8217;} to modify the output of 
  the perl builtin localtime.&nbsp; In other words, I&#8217;d do something like 
  this:<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">$ENV{&#8216;TZ&#8217;} = 
  &#8216;US/Eastern&#8217;;<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">@time = 
  localtime();<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">This use to give me the localtime 
  in whatever timezone was in ENV{&#8216;TZ&#8217;}.&nbsp; 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{&#8216;TZ&#8217;} doesn&#8217;t have any affect on 
  localtime).&nbsp; I&#8217;ve tried various modifications to my mod_perl install 
  (such as configuring PerlPassEnv, etc) but still can&#8217;t get it to work.&nbsp; 
  <o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Does anyone have any 
  recommendations, or thoughts?<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thank you in 
  advance,<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Tyler 
  Fullerton.</SPAN></FONT><o:p></o:p></P>
  <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
  style="FONT-SIZE: 12pt"><o:p>&nbsp;</o:p></SPAN></FONT></P></DIV></BLOCKQUOTE></BODY></HTML>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic