title: JodaTime - how to get current time in UTC
body: <p>I want to get the current time in UTC. What I do so far is following (just for testing purposes):</p>
  
  <pre><code>    DateTime dt = new DateTime();
      DateTimeZone tz = DateTimeZone.getDefault();
      LocalDateTime nowLocal = new LocalDateTime();
      DateTime nowUTC = nowLocal.toDateTime(DateTimeZone.UTC);
  
      Date d1 = nowLocal.toDate();
      Date d2 = nowUTC.toDate();
  
      L.d("tz: " + tz.toString());
      L.d("local: " + d1.toString());
      L.d("utc: " + d2.toString());
  </code></pre>
  
  <ul>
  <li><code>d1</code> is my local time, that's fine</li>
  <li><code>d2</code> is my local time + 1, but should be local time - 1...</li>
  </ul>
  
  <p>My local time zone is UTC+1 (according to the debug output and the list here: <a href="https://www.joda.org/joda-time/timezones.html" rel="noreferrer">https://www.joda.org/joda-time/timezones.html</a>)...</p>
  
  <p>How do I correctly convert from one time zone to another (inclusive the millisecond representation)?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I need the date/milliseconds... It's NOT about displaying the time correctly....</p>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>Now, with the help of a comment and an answer, I tried following:</p>
  
  <pre><code>    DateTimeZone tz = DateTimeZone.getDefault();
      DateTime nowLocal = new DateTime();
      LocalDateTime nowUTC = nowLocal.withZone(DateTimeZone.UTC).toLocalDateTime();
      DateTime nowUTC2 = nowLocal.withZone(DateTimeZone.UTC);
  
      Date dLocal = nowLocal.toDate();
      Date dUTC = nowUTC.toDate();
      Date dUTC2 = nowUTC2.toDate();
  
      L.d(Temp.class, "------------------------");
      L.d(Temp.class, "tz    : " + tz.toString());
      L.d(Temp.class, "local : " + nowLocal +     " | " + dLocal.toString());
      L.d(Temp.class, "utc   : " + nowUTC +       " | " + dUTC.toString()); // &lt;= WORKING SOLUTION
      L.d(Temp.class, "utc2  : " + nowUTC2 +      " | " + dUTC2.toString());
  </code></pre>
  
  <p><em>OUTPUT</em></p>
  
  <pre><code>tz    : Europe/Belgrade
  local : 2015-01-02T15:31:38.241+01:00 | Fri Jan 02 15:31:38 MEZ 2015
  utc   : 2015-01-02T14:31:38.241 | Fri Jan 02 14:31:38 MEZ 2015
  utc2  : 2015-01-02T14:31:38.241Z | Fri Jan 02 15:31:38 MEZ 2015
  </code></pre>
  
  <p>What I wanted was, that the local date displays 15 o'clock and utc date displays 14 o'clock...
  For now, this seems to work...</p>
  
  <p><strong>----- EDIT3 - Final solution -----</strong></p>
  
  <p>Hopefully, this is a good solution... I think, i respects all tipps i got...</p>
  
  <pre><code>    DateTimeZone tz = DateTimeZone.getDefault();
      DateTime nowUTC = new DateTime(DateTimeZone.UTC);
      DateTime nowLocal = nowUTC.withZone(tz);
  
      // This will generate DIFFERENT Dates!!! As I want it!
      Date dLocal = nowLocal.toLocalDateTime().toDate();
      Date dUTC = nowUTC.toLocalDateTime().toDate();
  
      L.d("tz    : " + tz.toString());
      L.d("local : " + nowLocal +     " | " + dLocal.toString());
      L.d("utc   : " + nowUTC +       " | " + dUTC.toString());
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>tz    : Europe/Belgrade
  local : 2015-01-03T21:15:35.170+01:00 | Sat Jan 03 21:15:35 MEZ 2015
  utc   : 2015-01-03T20:15:35.170Z | Sat Jan 03 20:15:35 MEZ 2015
  </code></pre>