title: How can I have JAX-RS return a Java 8 LocalDateTime property as a JavaScript-style Date String?
body: <p>I created a RESTful web service using JAX-RS method annotations:</p>
  
  <pre><code>@GET
  @Path("/test")
  @Produces(MediaType.APPLICATION_JSON)
  public MyThing test()
  {
      MyThing myObject = new MyThing(LocalDateTime.now());
      return myObject;
  }
  </code></pre>
  
  <p>This works nicely, but I'd like to adjust one thing: If the returned Java object contains a property of the new Java 8 LocalDateTime type, it is represented as a JSON object:</p>
  
  <pre><code>{"myDateTimeProperty":{"hour":14,"minute":32,"second":39,"year":2014,"month":"NOVEMBER","dayOfMonth":6,"dayOfWeek":"THURSDAY","dayOfYear":310,"monthValue":11,"nano":0,"chronology":{"calendarType":"iso8601","id":"ISO"}},...}
  </code></pre>
  
  <p>How can I tell JAX-RS to return a JavaScript Date.toJSON()-style String like</p>
  
  <pre><code>{"myDateTimeProperty":"2014-11-07T15:06:36.545Z",...}
  </code></pre>
  
  <p>instead?</p>