Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong timezone on connections endpoint #42

Closed
cimm opened this issue Mar 20, 2015 · 0 comments
Closed

Wrong timezone on connections endpoint #42

cimm opened this issue Mar 20, 2015 · 0 comments

Comments

@cimm
Copy link
Contributor

cimm commented Mar 20, 2015

Take a connection between 2 Belgian stations, Aalter to Aalst for example. The result will look something like:

<time formatted="2015-03-21T05:23:00Z">1426911780</time>

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.

@cimm cimm changed the title Wrong timezone ; Wrong timezone on connections endpoint Mar 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant