mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-17 19:59:50 +00:00
AbstractNavitiaProvider: Fix to expect and return UTC times.
This commit is contained in:
parent
751e0abdcd
commit
11c4303733
1 changed files with 7 additions and 2 deletions
|
@ -20,6 +20,7 @@ package de.schildbach.pte;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -317,11 +318,15 @@ public abstract class AbstractNavitiaProvider extends AbstractNetworkProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Date parseDate(final String dateString) throws ParseException {
|
private Date parseDate(final String dateString) throws ParseException {
|
||||||
return new SimpleDateFormat("yyyyMMdd'T'HHmmss").parse(dateString);
|
DateFormat format = new SimpleDateFormat("yyyyMMdd'T'HHmmss");
|
||||||
|
format.setTimeZone(timeZone);
|
||||||
|
return format.parse(dateString);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String printDate(final Date date) {
|
private String printDate(final Date date) {
|
||||||
return new SimpleDateFormat("yyyyMMdd'T'HHmmss").format(date);
|
DateFormat format = new SimpleDateFormat("yyyyMMdd'T'HHmmss");
|
||||||
|
format.setTimeZone(timeZone);
|
||||||
|
return format.format(date);
|
||||||
}
|
}
|
||||||
|
|
||||||
private LinkedList<Point> parsePath(final JSONArray coordinates) throws IOException {
|
private LinkedList<Point> parsePath(final JSONArray coordinates) throws IOException {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue