title: How to convert UTC date to UTC OffsetDateTime in java 8?
body: <p>How can I convert the date object which is already in UTC to an <code>OffsetDateTime</code> Object in UTC itself in Java? This logic should be written on a microservice where the timezone can be entirely different. So <code>.now()</code> and other things are ruled out, I guess. Also, I don't want to pass Timezone as params anywhere.</p>
  
  <p><strong>Sample code:</strong></p>
  
  <pre><code>public OffsetDateTime convertFrom(Date source) {
      LOGGER.info("source: " + source.toString());
      LOGGER.info("instant: " + source.toInstant().toString());
      LOGGER.info("response: " + source.toInstant().atOffset(ZoneOffset.UTC).toString());
      return source.toInstant().atOffset(ZoneOffset.UTC);
  }
  </code></pre>
  
  <p>and the output I get is:</p>
  
  <ul>
  <li><p>source: 2018-07-11 15:45:13.0</p></li>
  <li><p>instant: 2018-07-11T19:45:13Z</p></li>
  <li><p>response: 2018-07-11T19:45:13Z</p></li>
  </ul>
  
  <p>I want my output return to be <strong><em>2018-07-11 15:45:13Z</em></strong> for input <em>2018-07-11 15:45:13.0</em></p>