title: UTC to local time in millis using JodaTime
body: <p>I am attempting to show transactions over a certain time period using Jodatime. </p>
  
  <p>Our server requires a start date and end date to be in UTC (which is probably obvious). Therefore any business logic around these is using DateTime object with the timezone set to <code>DateTimeZone.UTC</code>, e.g.</p>
  
  <pre><code>mStartDate = DateTime.now(UTC).withTimeAtStartOfDay();
  </code></pre>
  
  <p>That works well except when it comes to <strong>display</strong> the time I don't know how to augment it for the local (system default) timezone. Ideally I would like to use the <code>DateUtils</code> <a href="https://developer.android.com/reference/android/text/format/DateUtils.html#formatDateRange(android.content.Context,%20java.util.Formatter,%20long,%20long,%20int,%20java.lang.String)" rel="nofollow noreferrer">formatDateRange</a> function passing in two local timestamps. But the <code>getMillis()</code> function doesn't seem to account for local offsets:</p>
  
  <p><a href="https://i.stack.imgur.com/azr2f.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/azr2f.png" alt="Timestamps returning same milisecond times"></a></p>
  
  <p>I have also tried this:</p>
  
  <pre><code>mTimePeriodTitle.setText(DateUtils.formatDateRange(mContext, f, mStartDate.getMillis(),
      mEndDate.getMillis(), DateUtils.FORMAT_SHOW_TIME,
      TimeZone.getDefault().getID()).toString());
  </code></pre>
  
  <p>But it hasn't made any difference. So my question is how can I get a nicely formatted local date range with 2 UTC timestamps?</p>