// Make sure (de)serialization of date time fields use the same ISO-8601
// date format (that includes milliseconds and time zone).
SimpleDateFormat dateFormat = new SimpleDateFormat(
"yyyy-MM-dd'T'HH:mm:ss.SSSZ");
DeserializationConfig deserializationConfig = objectMapper
.getDeserializationConfig().withDateFormat(dateFormat);
SerializationConfig serializationConfig = objectMapper
.getSerializationConfig().withDateFormat(dateFormat);
objectMapper.setDeserializationConfig(deserializationConfig);
objectMapper.setSerializationConfig(serializationConfig);