title: Converting local timestamp to UTC timestamp in Java
body: <p>I have a milliseconds-since-local-epoch timestamp that I'd like to convert into a milliseconds-since-UTC-epoch timestamp. From a quick glance through the docs it looks like something like this would work:</p>
  
  <pre><code>int offset = TimeZone.getDefault().getRawOffset();
  long newTime = oldTime - offset;
  </code></pre>
  
  <p>Is there a better way to do this?</p>