title: What's the best way to get the UTC offset in Perl?
body: <p>I need to get the UTC offset of the current time zone in Perl in a cross platform (Windows and various flavors of Unix) way.  It should meet this format:</p>
  
  <blockquote>
    <p>zzzzzz, which represents ±hh:mm in relation to UTC</p>
  </blockquote>
  
  <p>It looks like I should be able to get it via <code>strftime()</code>, but it doesn't appear to be consistent.</p>
  
  <p>Unix:</p>
  
  <pre><code>Input: perl -MPOSIX -e "print strftime(\"%z\", localtime());"
  Output: -0700
  </code></pre>
  
  <p>Windows:</p>
  
  <pre><code>Input: perl -MPOSIX -e "print strftime(\"%z\", localtime());"
  Output: Mountain Standard Time
  </code></pre>
  
  <p>While it appears that Unix is giving me what I want (or at least something close), Windows is not.  I'm pretty sure I can do it with <code>Date::Time</code> or similar, but I'd really like to not have any dependencies that I can't guarantee a user will have due to our wide install base.</p>
  
  <p>Am I missing something obvious here?  Thanks in advance.</p>