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.


In reply to Re^2: setting timezone in windows by Anonymous Monk
in thread setting timezone in windows by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.