title: Force Milliseconds When Serializing Instant to ISO8601 using Jackson
body: <p>I have some questions related to <strong>JSON serialization using Jackson</strong> in a project where I use <code>Spring Boot 2.0.0.M6</code>, <code>Spring Framework 5.0.1.RELEASE</code> and <code>Jackson 2.9.2</code>. </p>
  
  <p>I have configured the following Jackson-related settings in <code>application.properties</code>:</p>
  
  <pre><code>spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
  </code></pre>
  
  <p>Serialization works mostly as I need. Nevertheless, I have noticed that Jackson seems to cut-off milliseconds if they are <code>000</code>.</p>
  
  <p><strong>Test 1: Serialize Instant with milliseconds set to <code>000</code>:</strong></p>
  
  <ul>
  <li>Initialize Instant field using <code>Instant.parse("2017-09-14T04:28:48.000Z")</code></li>
  <li>Serialize it using Jackson</li>
  <li>Output will be <code>"2017-09-14T04:28:48Z"</code></li>
  </ul>
  
  <p><strong>Test 2: Serialize Instant with milliseconds set to some non-<code>000</code> value:</strong></p>
  
  <ul>
  <li>Initialize Instant field using <code>Instant.parse("2017-09-14T04:28:48.100Z")</code></li>
  <li>Serialize it using Jackson</li>
  <li>Output will be <code>"2017-09-14T04:28:48.100Z"</code></li>
  </ul>
  
  <p><strong>Questions</strong>:</p>
  
  <ul>
  <li>Is that behavior by design?</li>
  <li>Is there anything I can do to force serialization of <code>000</code>?</li>
  </ul>