title: Spring Boot change date format of request param field as DTO
body: <p>My controller has a <code>GET</code> endpoint which accept lots of query parameters. So, instead of having multiple <code>@QueryParam</code> I created a <code>CriteriaDTO</code> in order to perform dynamic queries to our Mongo database</p>
  
  <p>My controller endpoint :</p>
  
  <pre><code>@GetMapping
  public List&lt;MyObject&gt; getAll(@Valid CriteriaDTO criteriaDTO){
      return myObjectService.findAll(criteriaDTO);
  } 
  
  public class CriteriaDTO {
  
      private int offset = 0
      private int limit = 20
      @DateTimeFormat(pattern = "yyyy-MM-dd")
      private LocalDate minDate
  
      // getters, setters ...
  }
  </code></pre>
  
  <p>And, I want to pass the minDate is the URL with the following format <code>yyyy-MM-dd</code> but I need to convert it to the following format <code>yyyy-MM-dd'T'HH:mm:ss.SSS</code>.</p>
  
  <p>My question is : Is there any annotation or something else which accepts the first format <code>yyyy-MM-dd</code> and automatically convert it to another ? </p>
  
  <p>To be clear if I make the following call :</p>
  
  <p><code>http://localhost:8080/api/myobject?minDate=2020-01-01</code></p>
  
  <p>And then <code>criteriaDTO.getminDate()</code> will return <code>2020-01-01'T'00:00:00.000</code></p>
  
  <p>Thanks for your help :)</p>