koch-t / KV78Turbo-OVAPI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: Report timezone in all dates

gidema opened this issue · comments

At the moment the passtime data contains timezone/daylight savings time information for the LastUpdateTimeStamp field only. Would it be possible to add the information to all fields?
There is a difference between browsers for the way the new Date() js function interprets dates without timezone information.
Great work by the way!

DST is a bit of a clusterfuck, lastupdatetimestamp has the UTC-offset since it's sent out with a timezone.
The arrival/departure time fields are build from a combination of the OperationDate and the timefield which is in seconds since midnight at that OperationDate.
DST is in principle defined at noon of that operationdate. Nightbusses continue on the DST-ness of the previous day. Some operators operator additional trips to compensate for the additional hour, some do not.
Note: the transit-planners of 9292 cock up in the case there is no additional journey's are operated in the 2nd 02:00->03:00 section.

Except there is this clusterfuck situation at GVB and RET which actually have some journey's starting between 00:00:00 and 02:00:00. I still do not fully understand what the expected behaviour should be of those trips on the night of a DST switch.

Added complication: the AVL system of some operators starts to freak out between 2 am and 3am.

Thanks for the quick answer. I must admit that I didn't look at the source code before asking this question. Now I know, you're using a local time internally and it is not trivial to convert it to a universal time especially around the DST switch.
For now I'll just stick with the string value for my purpose.
You can see it at gertjanidema.nl/osmlayers. Select the facilities->transport->Busstop layer and pick a busstop in the Connexxion or U/OV area. If there's a 'Bustimes' button, it'll show the departure times from ovapi.nl. Getting all bus stop codes in openstreetmap is still some work to do.

Getting all the bus-stopcodes in OSM is not something to strive for, there are many cases where there are multiple codes per busstop sign. In the (near) future this should be more possible when the IFOPT/NDOV haltebeheer dataset is complete (haltebeheer.nl has a visualization of current work)