title: Using Spring @RestController to handle HTTP GET with ZonedDateTime parameters
body: <p>I'm creating an endpoint that will receive dates to do some filtering in the server side. The code looks like this:</p>
  
  <pre><code>@RequestMapping(
          value = "/test",
          method = RequestMethod.GET,
          produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE}
  )
  @ResponseStatus(HttpStatus.OK)
  public TestSummaryModel getTestSummaryByDate(
          @RequestParam ZonedDateTime start,
          @RequestParam ZonedDateTime end) {
  
      return testService.getTestBetween(start, end);
  
  }
  </code></pre>
  
  <p>When I try to invoke my endpoint I get an HTTP 400 error "The request sent by the client was syntactically incorrect."</p>
  
  <p>I have try different date formats but none of them worked. Am I missing something? I read about the @DateTimeFormat but even though I added it, was not working.</p>
  
  <pre><code>@RequestParam @DateTimeFormat(pattern = "dd-MM-yyyy") ZonedDateTime start
  </code></pre>
  
  <p>This is an example of the request I'm doing:</p>
  
  <p><a href="http://host/test-api/v1/test-summary/test?start=09-09-2015&amp;end=09-09-2015" rel="noreferrer">http://host/test-api/v1/test-summary/test?start=09-09-2015&amp;end=09-09-2015</a></p>
  
  <p>Thanks!</p>