"Surely there is some method or module that takes in a time specified in EST, and *poof* converts it to ACST?"

There certainly is...

use DateTime; my $time = DateTime->now( time_zone => 'America/New_York' ); $time->set_time_zone( 'Australia/South' ); print "$time\n";

If you want to use a specific time and date rather than "now", just use new instead of now to create the object...

my $time = DateTime->new( year => 2007, month => 12, day => 28, hour => 18, minute => 30, second => 0, time_zone => 'America/New_York', );

"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?

Not reliably, which is why it's strongly recommended you use the named timezones rather than the abbreviations, there are quite a few abbreviations that aren't unique. On unix machines where you can't tell which one 'date' refers to, you can often tell the real timezone by looking at the file /etc/localtime (the file info, not the contents, which are binary), on my machine it looks like this:

[jason@critter ~ 0]$ date Fri Dec 28 13:24:04 EST 2007 # oops, there are two ESTs, one at -0500 and one at +1000/+1100, which + one is it? [jason@critter ~ 0]$ ls -l /etc/localtime lrwxr-xr-x 1 root wheel 30 Dec 5 12:06 /etc/localtime@ -> /usr/sha +re/zoneinfo/US/Eastern

We're not surrounded, we're in a target-rich environment!

In reply to Re: Timezone conversion in Perl by jasonk
in thread 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.