Hi,

I have tried really hard searching for a solution to this problem in many places but have yet to find a satisfactory answer, so I hope someone here can enlighten me.

Currently I have a script that is running on a remote machine (in the States, the localtime of which is the EST), I'd like certain functions to actually execute between a range of times where I am (in South Australian, our timezone is ACST).

I've considered converting the localtime of the host machine to the GMT, then converting that to our timezone (+9.5 hours) but that does not take into account issues like DST which can skew things quite a little.

It'd be great if I can get the Perl script to "sort of" run using our local timezone through some environmental variable, but even then it is still subpar if it is something that is to be employed in a persistent process. Surely there is some method or module that takes in a time specified in EST, and *poof* converts it to ACST?

Is there a more elegant way of doing it?

Another issue that I noticed is on a Solaris box here, typing the 'date' command on the command line actually yields a "CST" timezone, which can be quite ambiguous with the American "CST", is there some way to differentiate the two to perl?


In reply to Timezone conversion in Perl by woei

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.