Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: TimeZoning oddities

by robin (Chaplain)
on Nov 02, 2005 at 12:13 UTC ( #504901=note: print w/replies, xml ) Need Help??

in reply to TimeZoning oddities

You can fix the problem by calling POSIX::tzset() after changing $ENV{TZ}.

It could be that this is the way it's supposed to work, and it's not a bug at all; although the behaviour is certainly inadequately documented and inconsistent. (BTW: the bug I was referring to is here, but I think it's not quite the same problem.)

Replies are listed 'Best First'.
Re^2: TimeZoning oddities
by JPaul (Hermit) on Nov 02, 2005 at 15:14 UTC

    I saw that in one of the PODs I was reading through - but since all the examples I had found (including on PM) did not include it, I assumed that it was not really necessary. Doofus.

    Thank you very much, this does the magic.

    -- Alexander Widdlemouse undid his bellybutton and his bum dropped off --

      At last I have found the definitive answer! The problem is with localtime rather than strftime.

      This problem happens only on Linux, and only with a threaded build of perl. There's some disgreement about whether the bug is in Linux or perl, but in either case a manual call to tzset is a good workaround.

      See the bug report and ensuing discussion here.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://504901]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2018-04-22 21:17 GMT
Find Nodes?
    Voting Booth?