Jackson serializes java.util.Date instances as numerical timestamps by default. You can set Jackson to use text representation with
mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); // it true by default
or provide your own JsonSerializer .
However, when you perform the conversion, the intermediate JSON and the target type do not have a Map to tell Jackson that he should deserialize him as a Date object. Without additional type information, Jackson will always deserialize it using its default values ( long , double , String , LinkedHashMap ).
Sotirios delimanolis
source share