in reply to setting timezone in windows

Oops. Bad on me; somehow convinced myself - despite a clear-enough question - that OP wanted to set system time:
This is really a question for a w32 forum; note that svenXY's method gives a conversion... but does NOT set system TZ.
However, if setting TZ is an acceptable alternate:

Diligent search here (or with ppm, if you're using Active State) for WIN::API may help you.

or, otherwise,

ppm's WIN32API-File-Time may (I have not checked it) also provide some guidance/clues.

Replies are listed 'Best First'.
Re^2: setting timezone in windows
by Anonymous Monk on Jan 19, 2006 at 17:57 UTC
    Me again...

    localtime is a built in perl function, I'm trying to modify its behaviour, so I think this question is a valid Perl question.Neverthless, maybe I'd have to ask first to ActiveState...

    Substract a constant to time() every time I call it IMHO it's not the answer. It's not the porpouse of localtime, if it were we only need gmtime.

    WIN32API-File-Time is related to file's times. Not work here.

    The only way to change the behaviour is to set from the DOS shell the TZ variable, that is:

    > set TZ=GTM 3

    and then run the script. Setting it by system("set TZ=..") doesn't seems to work neigther.

    I think it's a fail in the localtime implementation that only check TZ before the interpreter compile the code (setting TZ by system or %ENV in a BEGIN block doesn't work).

    Sorry, I'm know that win$ sucks. It's the real problem here.I'll try to solve it for a little while more before give up.

    Thanks for the answers.