Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use UTC everywhere #8

@elliottwilliams

Description

@elliottwilliams

So it seems like generally a good idea to use UTC on the backend, but I have a couple particular reasons:

  • Since GTFS is set to the agency's timezone, clients are expected to query in the "right timezone" of the agency. This works fine if the client is in the same region, but breaks if the client is outside the agency's timezone. Me checking BART in Indiana returns different results than someone checking it in California.
  • Providence uses Time.now to determine whether to request real-time departures, so the timezone of the server matters. This could be a problem, since one host runs multiple agencies, but the containers server components run in have their own timezone. A container's timezone defaults to UTC.

I think that the necessary steps would be to:

  • translate stop times in Timetable from the the agency timezone to UTC
  • configure clients / providence to use UTC for all time-related queries
  • (future-proofing) configure providence's agency.rb to know the agency's timezone. I imagine some future real-time applications will need to know the local agency time.
  • clarify the request timezone in this repo

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions