title: Get `Instant` from `ZonedDateTime` in java.time
body: <p>Given a <a href="http://docs.oracle.com/javase/8/docs/api/java/time/ZonedDateTime.html" rel="noreferrer"><code>ZonedDateTime</code></a> in the <a href="http://docs.oracle.com/javase/8/docs/api/java/time/package-summary.html" rel="noreferrer">java.time package</a> of Java 8 and later, how does one obtain an <a href="http://docs.oracle.com/javase/8/docs/api/java/time/Instant.html" rel="noreferrer"><code>Instant</code></a>?</p>
  
  <p>Going the other way ( <code>Instant</code> → <code>ZonedDateTime</code> ) is simply:</p>
  
  <pre><code>ZonedDateTime zdt = ZonedDateTime.ofInstant( instant , zoneId ) ;
  </code></pre>
  
  <p>Going from <code>ZonedDateTime</code> → <code>Instant</code> is needed for things like converting to the old-school <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Date.html" rel="noreferrer"><code>java.util.Date</code></a> class.</p>
  
  <pre><code>java.util.Date date = Date.fromInstant( instant ) ;
  </code></pre>