Having an issue with the FasterXML ObjectMapper setting the duedate
incorrectly when serializing. updated
and created
are fine when mapping. Only difference is the hours are not included and are not provided.
"fields": {
"updated": "2020-09-01T06:18:36.000+0900",
"duedate": "2020-08-04",
"created": "2020-07-31T08:25:54.000+0900"
}
This is my code:
ObjectMapper mapper = new ObjectMapper();
Fields fields = mapper.readValue(json, Fields.class);
System.out.println(fields.getFields().getDuedate());
Result: Mon Aug 03 19:00:00 CDT 2020
As you can see its off by a day and dont know where the hours came from. The result should be: Tue Aug 04 00:00:00 CDT 2020