title: GSON - Date format
body: <p>I'm trying to have a custom date format in Gson output, but <code>.setDateFormat(DateFormat.FULL)</code> doesn't seem to work and it the same with <code>.registerTypeAdapter(Date.class, new DateSerializer())</code>.</p>
  
  <p>It's like Gson doesn't care about the object "Date" and print it in its way.</p>
  
  <p>How can I change that?</p>
  
  <p>Thanks</p>
  
  <p>EDIT: </p>
  
  <pre><code>@Entity
  public class AdviceSheet {
    public Date lastModif;
  [...]
  }
  
  public void method {
     Gson gson = new GsonBuilder().setDateFormat(DateFormat.LONG).create();
     System.out.println(gson.toJson(adviceSheet);
  }
  </code></pre>
  
  <p>I always use <code>java.util.Date</code>; <code>setDateFormat()</code> doesn't work :(</p>