Specify time zone of local dates and times #10

Open
opened 2026-03-31 15:03:57 +02:00 by ansv7779 · 0 comments
Owner

Right now everything is UTC. Great if every API gives fully detailed dates and times with time zone information. Less great if you have to mock APIs that return "local" dates and times in an otherwise documented time zone.

An example of such an API is the SL Transport departure API that gives scheduled and expected times without time zone information because they are known to always be in the time zone "Europe/Stockhlom".

Currently the only workaround is setting the TZ environment variable which gets picked up by Debian but that affects all APIs. There's always the possibility of running multiple instances of the container for different time zones so it's not a complete blocker. Just documenting here for completeness as well as informing how to deal with it.

Right now everything is UTC. Great if every API gives fully detailed dates and times with time zone information. Less great if you have to mock APIs that return "local" dates and times in an otherwise documented time zone. An example of such an API is the [SL Transport departure API](https://www.trafiklab.se/api/our-apis/sl/transport/#/default/Departures) that gives scheduled and expected times without time zone information because they are known to always be in the time zone "Europe/Stockhlom". Currently the only workaround is setting the `TZ` environment variable which gets picked up by Debian but that affects all APIs. There's always the possibility of running multiple instances of the container for different time zones so it's not a complete blocker. Just documenting here for completeness as well as informing how to deal with it.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DMC/apimposter#10