Jackson JSON not serializing Joda DateTime correctly Jackson JSON not serializing Joda DateTime correctly json json

Jackson JSON not serializing Joda DateTime correctly


This seemed to do the trick for me:How to serialize Joda DateTime with Jackson JSON processer?

Basically, the idea was to create a class that extends org.codehaus.jackson.map.JsonSerializer with a overried serialize method:

public void serialize(DateTime value, JsonGenerator gen, SerializerProvider arg2) throws IOException, JsonProcessingException {    gen.writeString(formatter.print(value));}

Then just use that custom serializer in place of DateTimeSerializer.