Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: How to set a processes notion of the timezone on win32?

by jaldhar (Vicar)
on Mar 02, 2010 at 18:34 UTC ( #826220=note: print w/ replies, xml ) Need Help??


in reply to How to set a processes notion of the timezone on win32?

Thanks to those that replied.

Jan "jdb" Dubois on #win32@irc.perl.org suggested a fix that works well.

use Time::Piece; $ENV{TZ} = 'UTC'; Time::Piece::_tzset();

According to Jan, this requires atleast Time::Piece 1.14 and is fully fixed in 1.17.

There is also a tzset() in POSIX which I had initially considered but it gives a "not implemented" error on current strawberry perl. Hopefully that is just a bug which will soon be rectified.

Update: Time::Piece 1.12 appears to work as well.

--
જલધર


Comment on Re: How to set a processes notion of the timezone on win32?
Download Code
Re^2: How to set a processes notion of the timezone on win32?
by Anonymous Monk on Mar 02, 2010 at 23:59 UTC
    There is also a tzset() in POSIX which I had initially considered but it gives a "not implemented" error on current strawberry perl.

    Hmm, thats a very stupid bug in strawberryperl. I compiled my perl with mingw like strawberry, and my POSIX comes with tzset

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2015-07-02 02:08 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 (25 votes), past polls