title: Get Military Time Zone Abbreviation
body: <p>I have a <code>org.joda.time.DateTime</code> object and I need to retrieve the military time zone abbreviation (e.g. <strong>T</strong> for UTC-07:00, <strong>U</strong> for UTC-08:00, <strong>Z</strong> for UTC±00:00).</p>
  
  <p>See <a href="http://en.wikipedia.org/wiki/List_of_military_time_zones">http://en.wikipedia.org/wiki/List_of_military_time_zones</a></p>
  
  <p>Here's how I'm currently doing it:</p>
  
  <pre><code>int offset = dt.getZone().toTimeZone().getRawOffset() / (60 * 60 * 1000);
  String timeZoneCode = timeZoneCodeMap.get(offset);
  </code></pre>
  
  <p>where <code>timeZoneCodeMap</code> is a <code>HashMap&lt;Integer, String&gt;</code> that is initialized with entries like the following</p>
  
  <pre><code>timeZoneCodeMap.put(1, "A");
  timeZoneCodeMap.put(2, "B");
  timeZoneCodeMap.put(3, "C");
  ...
  timeZoneCodeMap.put(-10, "W");
  timeZoneCodeMap.put(-11, "X");
  timeZoneCodeMap.put(-12, "Y");      
  timeZoneCodeMap.put(0, "Z");
  </code></pre>
  
  <p>Does there exist a function or library (in Joda or otherwise) that already contains a mapping of time zones to military abbreviations?</p>
  
  <p>Feel free to let me know if there is a better way to calculate the offset as well.</p>