BahnProvider and Timezones

84 views
Skip to first unread message

Torsten Grote

unread,
Nov 29, 2017, 10:09:42 AM11/29/17
to public-transport...@googlegroups.com
Hi all,

apparently the BahnProvider is even used in the UK where they have
another timezone:

https://github.com/grote/Transportr/issues/382

What is the recommendation to deal with this?

I found a AbstractNetworkProvider#setTimeZone() method, but it is protected.

Kind Regards,
Torsten

Andreas Schildbach

unread,
Nov 29, 2017, 11:50:19 AM11/29/17
to public-transport...@googlegroups.com
The timeZone property is meant so that the parser can convert any time
to UTC (if the API doesn't already return UTC -- newer APIs do if I
remember right).

Any display time conversion you are meant to do yourself. You can use
the timeZone field for that if you want, if you're aware of this:

Providers that stretch multiple timezones are a problem. Years ago, I
did some tests with bahn.de spanning multiple timezones (into the east
direction, so Poland, Russia and so on) and the bahn.de Hafas API seemed
to return German times for all stops of a connection.

Ideally an app would display-time-convert such a connection based on the
timezone of the stops, but so far I cannot find a way to determine the
timezone of a stop. I've never seen any timezone field in any of the APIs.
Reply all
Reply to author
Forward
0 new messages