aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-09-22 11:40:02 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-09-22 11:40:02 +1200
commita7296d99876000e65bef9b9df708f57ebabbe894 (patch)
tree27175047d4b59b55c3e59d5bfafff96255570202 /src/org/traccar/web
parent02d5eb894a4c5f5fe8270303af2c8ba4be03b530 (diff)
downloadtrackermap-server-a7296d99876000e65bef9b9df708f57ebabbe894.tar.gz
trackermap-server-a7296d99876000e65bef9b9df708f57ebabbe894.tar.bz2
trackermap-server-a7296d99876000e65bef9b9df708f57ebabbe894.zip
Fix date formatting (fix #4063)
Diffstat (limited to 'src/org/traccar/web')
-rw-r--r--src/org/traccar/web/CsvBuilder.java3
-rw-r--r--src/org/traccar/web/GpxBuilder.java5
2 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/web/CsvBuilder.java b/src/org/traccar/web/CsvBuilder.java
index f7455b528..cd4efea9f 100644
--- a/src/org/traccar/web/CsvBuilder.java
+++ b/src/org/traccar/web/CsvBuilder.java
@@ -19,7 +19,6 @@ package org.traccar.web;
import java.beans.Introspector;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
@@ -91,7 +90,7 @@ public class CsvBuilder {
addSeparator();
} else if (method.getReturnType().equals(Date.class)) {
Date value = (Date) method.invoke(object);
- builder.append(DateTimeFormatter.ISO_DATE_TIME.format(value.toInstant()));
+ builder.append(Context.DATE_FORMATTER.format(value.toInstant()));
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 a4daf154e..41f406eb7 100644
--- a/src/org/traccar/web/GpxBuilder.java
+++ b/src/org/traccar/web/GpxBuilder.java
@@ -16,8 +16,9 @@
*/
package org.traccar.web;
-import java.time.format.DateTimeFormatter;
import java.util.Collection;
+
+import org.traccar.Context;
import org.traccar.helper.UnitsConverter;
import org.traccar.model.Position;
@@ -50,7 +51,7 @@ public class GpxBuilder {
public void addPosition(Position position) {
builder.append(String.format(POINT, position.getLatitude(), position.getLongitude(),
- DateTimeFormatter.ISO_DATE_TIME.format(position.getFixTime().toInstant()), position.getAltitude(),
+ Context.DATE_FORMATTER.format(position.getFixTime().toInstant()), position.getAltitude(),
position.getCourse(), UnitsConverter.mpsFromKnots(position.getSpeed())));
}