aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-01-03 15:11:15 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-01-03 15:11:15 +1300
commit1f1e3f227304bae09596fb511d6210438f394ca4 (patch)
treec5615863f9e5c050c4f3d101c868d1004949828f
parenta14db4167bfa4b7bff3a804a0724e7678fd5fe26 (diff)
downloadtraccar-server-1f1e3f227304bae09596fb511d6210438f394ca4.tar.gz
traccar-server-1f1e3f227304bae09596fb511d6210438f394ca4.tar.bz2
traccar-server-1f1e3f227304bae09596fb511d6210438f394ca4.zip
Update JSON serialization date format
-rw-r--r--src/org/traccar/api/ObjectMapperProvider.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/org/traccar/api/ObjectMapperProvider.java b/src/org/traccar/api/ObjectMapperProvider.java
index b323a318b..7e6d66eb6 100644
--- a/src/org/traccar/api/ObjectMapperProvider.java
+++ b/src/org/traccar/api/ObjectMapperProvider.java
@@ -16,13 +16,10 @@
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;
-import java.text.DateFormat;
import java.text.SimpleDateFormat;
-import java.util.TimeZone;
@Provider
public class ObjectMapperProvider implements ContextResolver<ObjectMapper> {
@@ -30,7 +27,8 @@ public class ObjectMapperProvider implements ContextResolver<ObjectMapper> {
private ObjectMapper mapper = new ObjectMapper();
public ObjectMapperProvider() {
- mapper.setConfig(mapper.getSerializationConfig().without(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS));
+ mapper.setConfig(mapper.getSerializationConfig().with(
+ new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'")));
}
@Override