Instant Time parsing error (Unable to obtain Instant from TemporalAccessor)
<p>After running my program, I get this weird crash occurring after around 2 hours of running it stating that it can't parse the date.</p>

<pre><code>Text '2016-10-26T12:31:39.084726218Z' could not be parsed: Unable to obtain Instant from TemporalAccessor: {InstantSeconds=1477485099, NanoOfSecond=84726218},ISO of type java.time.format.Parsed
at java.time.format.DateTimeFormatter.createError(DateTimeFormatter.java:1919)
</code></pre>

<p>Does anyone knows why it gives this? Since when looking online, I found that it could be due to an incorrect format, but since I did not specify the format this is not the case for me.</p>

<p>The code that parses my timestamp is the following:</p>

<pre><code>Instant instant = Instant.parse(cAdvisor.getTimestamp());
Long epoch = instant.getEpochSecond();
</code></pre>

<p>Note: The <code>cAdvisor.getTimestamp()</code> method returns a string such as: <code>'2016-10-26T12:31:39.084726218Z'</code></p>

<p>Note 2: My java version reports this</p>

<pre><code>java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b115)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b57, mixed mode)
</code></pre>

<p>Update #1: The following code replicates this issue:</p>

<pre><code>import java.time.Instant;
import java.util.Random;

// one class needs to have a main() method
public class Test
{
    // arguments are passed using the text field below this editor
    public static void main(String[] args)
    {
        Random rand = new Random();
        for (int i = 0; i &lt; 100000; i++) {
            String date = "2016-10-26T12:31:39.0847";

            for (int j = 0; j &lt; rand.nextInt(6); j++) {
                date += rand.nextInt(10);
            }

            date += "Z";

            date = date.replace("26", "" + (rand.nextInt(20) + 10));


            Instant instant = Instant.parse(date);
            Long epoch = instant.getEpochSecond();
            System.out.println(epoch);
        }
    }
}
</code></pre>

<p>Which generates following stacktrace</p>

<pre><code>Exception in thread "main" java.time.format.DateTimeParseException: Text '2016-10-27T12:31:39.0847Z' could not be parsed: Unable to obtain Instant from TemporalAccessor: {InstantSeconds=1477571499, NanoOfSecond=84700000},ISO of type java.time.format.Parsed
        at java.time.format.DateTimeFormatter.createError(DateTimeFormatter.java:1919)
        at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1854)
        at java.time.Instant.parse(Instant.java:392)
        at Test.main(Test.java:23)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
        Caused by: java.time.DateTimeException: Unable to obtain Instant from TemporalAccessor: {InstantSeconds=1477571499, NanoOfSecond=84700000},ISO of type java.time.format.Parsed
        at java.time.Instant.from(Instant.java:375)
        at java.time.Instant$$Lambda$7/1018081122.queryFrom(Unknown Source)
        at java.time.format.Parsed.query(Parsed.java:226)
        at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1850)
        ... 7 more
</code></pre>