title: Hibernate query returning wrong date
body: <p>When i retrieve a date from a mysql table it always return the date 1 day before, the date format is yyyy-MM-dd, so if i have 2018-10-17 when i print the result it comes as 2018-10-16. If i use the command line to check the dates, they are correct.
  This is the method inside the Dao class that retrieves the dates:</p>
  
  <pre><code>public List&lt;LocalDate&gt; getDates(String username){
      List&lt;LocalDate&gt; dates;
      Query query = manager.createQuery("select date from Calendar where username =:username");
      query.setParameter("username",username);
      dates = query.getResultList();
      return dates;
  }
  </code></pre>
  
  <p>When I print the list all the dates are printed 1 day before as I was on my sql.</p>
  
  <p>This is how I get the dates on the servlet and use hibernate to store the dates on mysql.</p>
  
  <pre><code>String dateString = request.getParameter("date");
  DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
  LocalDate dataInicial = LocalDate.parse(dataInicialString, formatter);
  </code></pre>
  
  <p>The Datatype that im using in mysql is DATE.
  Then I user hibernate to do the rest for me, if you need any piece of code that I didin't provide please ask me. 
  Thx in advance.</p>
  
  <p>Sorry for bad english!</p>