Skip to content

Stoptimes are off by one day at night #106

@PasiSalenius

Description

@PasiSalenius

Querying stoptimes for route 110T at around 01 AM 08.01.2016 using

{
  trip(id: "HSL:2110T_20170102_La_2_2445") {
    stoptimesForDate(serviceDay: "20170108") {
      stop {
        gtfsId
      }
      scheduledArrival
      realtimeArrival
      scheduledDeparture
      realtimeDeparture
      serviceDay
      realtime
    }
  }
}

returns the first stoptime as follows

{
  "stop": {
    "gtfsId": "HSL:2111230"
  },
  "scheduledArrival": 89100,
  "realtimeArrival": 89100,
  "scheduledDeparture": 89100,
  "realtimeDeparture": 89100,
  "serviceDay": 1483826400,
  "realtime": false
}

The serviceDay + scheduledDeparture sum 1483915500 converts to 01/08/2017 @ 10:45pm (UTC) which in Finnish time equals 1/9/2017, 12:45:00 AM GMT+2:00.

It seems to be because of incorrect serviceDay: "20170108" in the query. Do you have any suggestions how to handle such queries near day changes?

edit:
On further inspection there's nothing wrong in the graphQL data, only it is now difficult to tell the start date for a trip without always including full list of stoptimes in the query and checking the first one. Would be very helpful to have a startDate property available in Trip itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions