From a14db4167bfa4b7bff3a804a0724e7678fd5fe26 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 3 Jan 2016 13:44:26 +1300 Subject: Another update for date serialization --- src/org/traccar/api/ObjectMapperProvider.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/org') diff --git a/src/org/traccar/api/ObjectMapperProvider.java b/src/org/traccar/api/ObjectMapperProvider.java index 5a9cbb9d9..b323a318b 100644 --- a/src/org/traccar/api/ObjectMapperProvider.java +++ b/src/org/traccar/api/ObjectMapperProvider.java @@ -16,6 +16,7 @@ package org.traccar.api; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; import javax.ws.rs.ext.ContextResolver; import javax.ws.rs.ext.Provider; @@ -29,11 +30,7 @@ public class ObjectMapperProvider implements ContextResolver { private ObjectMapper mapper = new ObjectMapper(); public ObjectMapperProvider() { - DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); - dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); - - mapper.setConfig(mapper.getSerializationConfig().with(dateFormat)); - mapper.setConfig(mapper.getDeserializationConfig().with(dateFormat)); + mapper.setConfig(mapper.getSerializationConfig().without(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)); } @Override -- cgit v1.2.3