title: how to use annotation to validate LocalDateTime in spring boot
body: <p>I'm using the @Valid to validate the RequestBod data, see bellow:</p>
  <p>Controller MemberController.java</p>
  <pre><code>public R&lt;String&gt; addMember(@Valid @RequestBody AddMemberVO memberVO) {
      ...
  }
  </code></pre>
  <p>Model AddMemberVO.java</p>
  <pre><code>public class AddMemberVO{
      //Member card start time
      private LocateDateTime startTime;
      
      //Member card end time
      private LocateDateTime endTime;
      
      ...
  }
  </code></pre>
  <p>For this api, i want to validate the startTime and endTime using annotation.</p>
  <p>all date use the same pattern <strong>yyyy-MM-dd HH:mm:ss</strong></p>
  <p>if input:
  {
  &quot;startTime&quot;:&quot;2021-10-01 <strong>94</strong>:00:00&quot;,
  &quot;EndTime&quot;:&quot;2021-10-01 14:00:00&quot;
  }
  <strong>except result</strong>: startTime format is invalid.</p>
  <p>if input:
  {
  &quot;startTime&quot;:&quot;2021-<strong>19</strong>-01 00:00:00&quot;,
  &quot;EndTime&quot;:&quot;2021-10-01 14:00:00&quot;
  }
  <strong>except result</strong>: startTime format is invalid.</p>
  <p>i found a way - change the startTime and endTime from LocalDateTime to String, but i don't think this is a good idea. because if changed, I should do a lot of things about convert String to LocalDateTime.</p>
  <p>is there any other ways to validate this scene(use LocalDateTime) for my code?</p>