aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-11-08 13:37:38 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2018-11-08 13:37:38 +1300
commit9c9370f72c51d7466d3b25a59264ee98f4319b3a (patch)
tree1fca14e8a624e79f86b913dc60f94a93513a8eb0 /src/org/traccar/web
parent81d2b86ac7cca874b32c94fffa28b902c6fb0eca (diff)
downloadtraccar-server-9c9370f72c51d7466d3b25a59264ee98f4319b3a.tar.gz
traccar-server-9c9370f72c51d7466d3b25a59264ee98f4319b3a.tar.bz2
traccar-server-9c9370f72c51d7466d3b25a59264ee98f4319b3a.zip
Fix time formatting issues
Diffstat (limited to 'src/org/traccar/web')
-rw-r--r--src/org/traccar/web/CsvBuilder.java3
-rw-r--r--src/org/traccar/web/GpxBuilder.java4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/org/traccar/web/CsvBuilder.java b/src/org/traccar/web/CsvBuilder.java
index cd4efea9f..3fe7e408f 100644
--- a/src/org/traccar/web/CsvBuilder.java
+++ b/src/org/traccar/web/CsvBuilder.java
@@ -31,6 +31,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.traccar.Context;
+import org.traccar.helper.DateUtil;
public class CsvBuilder {
@@ -90,7 +91,7 @@ public class CsvBuilder {
addSeparator();
} else if (method.getReturnType().equals(Date.class)) {
Date value = (Date) method.invoke(object);
- builder.append(Context.DATE_FORMATTER.format(value.toInstant()));
+ builder.append(DateUtil.formatDate(value));
addSeparator();
} else if (method.getReturnType().equals(Map.class)) {
Map value = (Map) method.invoke(object);
diff --git a/src/org/traccar/web/GpxBuilder.java b/src/org/traccar/web/GpxBuilder.java
index 41f406eb7..638d100e5 100644
--- a/src/org/traccar/web/GpxBuilder.java
+++ b/src/org/traccar/web/GpxBuilder.java
@@ -18,7 +18,7 @@ package org.traccar.web;
import java.util.Collection;
-import org.traccar.Context;
+import org.traccar.helper.DateUtil;
import org.traccar.helper.UnitsConverter;
import org.traccar.model.Position;
@@ -51,7 +51,7 @@ public class GpxBuilder {
public void addPosition(Position position) {
builder.append(String.format(POINT, position.getLatitude(), position.getLongitude(),
- Context.DATE_FORMATTER.format(position.getFixTime().toInstant()), position.getAltitude(),
+ DateUtil.formatDate(position.getFixTime()), position.getAltitude(),
position.getCourse(), UnitsConverter.mpsFromKnots(position.getSpeed())));
}