schaerfo / journeyplanner

Plan your train journeys more flexibly
GNU General Public License v3.0
2 stars 0 forks source link

Departure/arrival time are shown in UTC±0. #7

Open schaerfo opened 1 year ago

schaerfo commented 1 year ago

Describe the bug The departure and arrival times of trains are shown in UTC time zone, instead of the local time of the respective stop.

Steps To Reproduce

  1. Open the app
  2. Add new journey
  3. Add initial leg, select "Line"
  4. Search for "ICE 1004"
  5. Open the line run

Expected behavior The departure times of the selected train run are shown in the local time zone of the respective stop. For this train, this is UTC+01 or UTC+02, depending on daylight saving time.

Actual behavior The departure times are shown in UTC±0.

Screenshots What Journey Planner shows: Screenshot_20231029-163608_journeyplanner_fl

Departure times in local time: image

Further Information

schaerfo commented 1 year ago

Unfortunately, it seems like there is no straightforward way to fix this. The DateTime type supplied by the Dart core library allows setting the time zone only to UTC±0 (this is currently being used) or the local time zone of the device. The latter is not desirable either, since the displayed times would be off by an hour when viewing a journey set in the DST period during the standard time period or vice versa.

While there is the 3rd party timezone package, the types provided by that require the time zone to be set manually by name (e. g. "Europe/Berlin"). This is not satisfactory either since the time zone names would have to be stored for each station. Adding the possibility to set the time zone from the UTC offset given in an ISO 8601 time stamp has been requested (srawlins/timezone#182).