Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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 avoiding work at the Monastery: (6)
As of 2014-08-30 02:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (291 votes), past polls