title: ZonedDateTime.parse bug?
body: <p>Given a <code>ZonedDateTime</code>, calling <code>toString</code> then <code>ZonedDateTime.parse</code> returns a different time in some cases.</p>
  
  <p>Here is a specific example. Code is in Scala but it's no different in Java.</p>
  
  <pre><code>import java.time._
  
  val t = 1193534827725L
  val z = ZoneId.of("Europe/Paris")
  
  val a = Instant.ofEpochMilli(t).atZone(z) // 2007-10-28T02:27:07.725+01:00[Europe/Paris]
  val b = ZonedDateTime.parse(a.toString)   // 2007-10-28T02:27:07.725+02:00[Europe/Paris]
  a == b // returns false!
  </code></pre>
  
  <p>The re-parsed value also has a different epochMilli:</p>
  
  <pre><code>scala&gt; List(a, b).map(_.toInstant.toEpochMilli)
  res46: List[Long] = List(1193534827725, 1193531227725)
  
  scala&gt; List(a, b).map(_.toInstant.toEpochMilli == t)
  res47: List[Boolean] = List(true, false)
  </code></pre>
  
  <p>Using <code>.format(DateTimeFormatter.ISO_ZONED_DATE_TIME)</code> instead of <code>.toString</code> doesn't work either.</p>
  
  <p>According to the Javadoc for <code>Instant#atZone</code> which defers to <a href="https://docs.oracle.com/javase/8/docs/api/java/time/ZonedDateTime.html#ofInstant-java.time.Instant-java.time.ZoneId-" rel="nofollow">https://docs.oracle.com/javase/8/docs/api/java/time/ZonedDateTime.html#ofInstant-java.time.Instant-java.time.ZoneId-</a></p>
  
  <blockquote>
    <p>Converting an instant to a zoned date-time is simple as there is only
    one valid offset for each instant.</p>
  </blockquote>
  
  <p>What's going on?</p>
  
  <p><strong>Edit:</strong> It's also worth mentioning that daylight savings occurred around the sample time (<a href="http://www.timeanddate.com/time/change/france/paris?year=2007" rel="nofollow">ref</a>) such that there were two instances of <code>02:27:07.725</code>. As you can see from <code>.toString</code> the offset is correct but parsing doesn't seem to respect it.</p>