Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: %ENV{TZ} does not always affect CORE::localtime() under multi-threaded perl

by Chmrr (Vicar)
on Apr 16, 2003 at 22:35 UTC ( #251074=note: print w/ replies, xml ) Need Help??


in reply to %ENV{TZ} does not always affect CORE::localtime() under multi-threaded perl

This is a problem on the C level, I believe. The localtime(3) call does not always check the current value of the TZ environment variable. To force it to do so, POSIX-compliant systems should use the tzset(3) call.

You can imitate this in perl via:

use POSIX; $\ = "\n"; $ENV{TZ} = "EST"; POSIX::tzset(); print scalar localtime(); $ENV{TZ} = "DST"; POSIX::tzset(); print scalar localtime();

perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'


Comment on Re: %ENV{TZ} does not always affect CORE::localtime() under multi-threaded perl
Select or Download Code
Re: Re: %ENV{TZ} does not always affect CORE::localtime() under multi-threaded perl
by dtr (Scribe) on Jul 23, 2003 at 17:08 UTC
    This works fine from a script, but does not work under mod_perl_2! Do you have any suggestions as to how I might go about getting this working under mod_perl_2?????

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://251074]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2015-07-03 22:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls