Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by jaldhar (Vicar)
on Mar 02, 2010 at 18:34 UTC ( [id://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.

--
જલધર

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://826220]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2024-04-18 06:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found