title: Validate datetime format "yyyy-MM-dd HH:mm:ss" in springboot
body: <p>Here is my Json data</p>
  <pre><code>{
       &quot;arrivaldatetime&quot;: &quot;2020-08-21 11:50:09&quot;
  }
  </code></pre>
  <p>Below is my Model class</p>
  <pre><code>@Column(name = &quot;ARRIVAL_DATETIME&quot;)
  @JsonFormat(pattern=&quot;yyyy-MM-dd HH:mm:ss&quot;)
  @Temporal(TemporalType.DATE)
  private Date arrivaldatetime;
  </code></pre>
  <p>How to validate arrivaldatetime ? it should allow only proper date and time format &quot;yyyy-MM-dd HH:mm:ss&quot;</p>
  <p>here is sample screenshot of json request which taking wrong date.
  [1]: <a href="https://i.stack.imgur.com/MSRmj.png" rel="nofollow noreferrer">https://i.stack.imgur.com/MSRmj.png</a></p>