title: Why is Instant.now() sometimes formatted differently?
body: <p>I have code that looks like this:</p>
  
  <pre><code>String PROPER_DATE_FORMAT = "yyyy-MM-dd";
  String format = "yyyy-MM-dd'T'HH:mm:ss.SSSX";
  
  SimpleDateFormat sdf = new SimpleDateFormat(format);
  Date d = sdf.parse(Instant.now().toString());
  SimpleDateFormat properFormat = new SimpleDateFormat(PROPER_DATE_FORMAT);
  String formatterDate = properFormat.format(d);
  </code></pre>
  
  <p>Now, most of the time, this code works but every now and then, I'll Instant.now() returning <code>2018-05-25T18:56:09Z</code> and then it will throw an exception bc the format doesn't match. </p>
  
  <p>Why is it sometimes inconsistent?</p>
  
  <p>The exception is <code>java.lang.RuntimeException: java.text.ParseException: Unparseable date: "2018-05-25T18:56:09Z"</code></p>
  
  <p>Normally, when <code>Instant.now().toString()</code> does return a String with the above format. Again, this code works most of the time but there are a few times when it doesn't and I'm puzzled as to why.</p>
  
  <p>I thought about whether it was because there's a zero at the end but just wasn't displayed but I'm not convinced because I was able to get a value of 2018-05-25T20:06:58.900Z as a result of Instant.now().toString()</p>