When working with APIs, it's crucial to handle timezones properly to ensure consistency and accuracy in data across different regions and systems. This section provides guidelines and details on how timezones are managed and represented within this API.5.
Handling Timezones in Requests
6.
Handling Timezones in Responses
8.
Daylight Saving Time (DST)
UTC (Coordinated Universal Time) is the standard time used by this API. All timestamps are expected to be in UTC unless specified otherwise.
📌
2023-07-18T15:23:45Z where the Z denotes Zulu time, another name for UTC.
If timestamps are provided in a different timezone, they should include an offset from UTC.
📌
Example
2023-07-18T15:23:45+02:00 indicates the time is two hours ahead of UTC.
All datetime strings should adhere to the ISO 8601 format. This ensures consistency and avoids ambiguity.
📌
Example
2023-07-18T15:23:45Z or 2023-07-18T13:23:45-02:00.
When specifying a timezone, use the IANA Time Zone Database format (e.g., America/New_York, Europe/London).
📌
Example
2023-07-18T15:23:45-04:00[America/New_York].
Handling Timezones in RequestsAlways specify the timezone when sending datetime data to the API. If not specified, the API assumes UTC.
{
"event_time": "2023-07-18T15:23:45Z"
}
Handling Timezones in ResponsesThe API will return all datetime data in UTC by default. If a different timezone is required, use the appropriate request parameters or headers to specify the desired timezone.
{
"event_time":"2023-07-18T15:23:45Z"
}
For clients requiring local time, the API supports conversion parameters. Ensure the client properly converts the UTC time to the local time based on their specific needs.
{
"event_time_utc": "2023-07-18T15:23:45Z",
"event_time_local": "2023-07-18T11:23:45-04:00"
}
Daylight Saving Time (DST)Be aware of Daylight Saving Time changes as they can affect local times. The API will automatically adjust times for timezones observing DST.
Modified at 2024-07-19 09:16:55