Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 perusing the Monastery: (15)
As of 2014-12-18 14:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (56 votes), past polls