title: Jackson set global date format for all Date fields
body: <p>I am working on <strong>non spring boot</strong> project.</p>
  
  <p>There are plenty of data objects and it is starting to get inconvenient to annotate all date fields with JsonFormat.</p>
  
  <pre><code>@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = JacksonSerialiser.DATE_FORMAT)
  private Date someDate;
  </code></pre>
  
  <p>I know I can set date format directly on the ObjectMapper</p>
  
  <pre><code>SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_FORMAT);
  OBJECT_MAPPER.setDateFormat(simpleDateFormat);
  </code></pre>
  
  <p>This works if all serialization/deserialization is done directly using the object mapper.</p>
  
  <p>You could implement CustomDateSerializer by extending <code>StdSerializer&lt;Date&gt;</code>, but again in order for the format to be applied you need to specify this on field level like so:</p>
  
  <pre><code>@JsonSerialize(using = CustomDateSerializer.class)
  public Date someDate;
  </code></pre>
  
  <p>With spring boot there is property you can use:</p>
  
  <pre><code>spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
  </code></pre>
  
  <p>Would be great if I can set such property without spring.</p>