You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The formatted date string has an extra Z at the end meaning Zulu time or UTC or GMT according to the ISO 8601 standard (and explained in the iRail API docs). This is the UK timezone, not the Belgian one, we live in the Central European Timezone or CET.
So, the API basically returns 2 different times for the same event. The timestamp from the example would indicate the train leaves at 04:23:00 GMT while the formatted time tells you it's leaving an hour later.
I would just drop the Z in the formatted time. The ISO 8601 standard says that when no UTC relation information is given the time is assumed to be in local time, exactly what we want here (not sure if the API can return train connections that cross timezones like the Eurostar for example, in that case we probably want the timezone in there).
Timezones and programming... we'll never be friends.
The text was updated successfully, but these errors were encountered:
cimm
changed the title
Wrong timezone ;
Wrong timezone on connections endpoint
Mar 20, 2015
Take a connection between 2 Belgian stations, Aalter to Aalst for example. The result will look something like:
The formatted date string has an extra
Z
at the end meaning Zulu time or UTC or GMT according to the ISO 8601 standard (and explained in the iRail API docs). This is the UK timezone, not the Belgian one, we live in the Central European Timezone or CET.So, the API basically returns 2 different times for the same event. The timestamp from the example would indicate the train leaves at 04:23:00 GMT while the formatted time tells you it's leaving an hour later.
I would just drop the
Z
in the formatted time. The ISO 8601 standard says that when no UTC relation information is given the time is assumed to be in local time, exactly what we want here (not sure if the API can return train connections that cross timezones like the Eurostar for example, in that case we probably want the timezone in there).Timezones and programming... we'll never be friends.
The text was updated successfully, but these errors were encountered: