Discussions
Date/Times
The StartDate
and EndDate
fields of drives returned by endpoints, such as Get List of Trips with Details, have a date, time, and time zone (e.g., 2024-08-01T20:35:42-05:00). However, the Daily Statistics and Daily Safety Score endpoints expect their StartDate
and EndDate
parameters to be local dates and their responses have ReportDate
and CalcDate
fields that return local dates (e.g., 2024-08-01T00:00:00) with a midnight time.
How do these "daily" endpoints decide which drives are included in each day given drives include time zones, but days do not. Does the internal logic assume all times are UTC? Or do they drop the drives' time zones when decided to which day they belong? For example, consider a drive that started (or ended) at 2024-08-01T20:35:42-05:00. Is the drive part of 2024-08-01 or 2024-08-02? Note: 2024-08-01T20:35:42-05:00 in the CDT time zone is 2024-08-02T01:35:42Z in UTC.
Hi Kevin,
Thank you for your questions.
We calculate the user’s timezone based on the timezone of their trips. As a result, when you retrieve statistics via the Daily Statistics and Daily Safety Score endpoints, the data is provided in the user’s local timezone.
Regarding how drives are included in daily reports, the internal logic uses the user's local timezone, not UTC. For example, a drive that starts or ends at 2024-08-01T20:35:42-05:00 (CDT) would be considered part of August 1st in the user’s timezone, even though the UTC equivalent would fall on August 2nd. In summary, the “daily” endpoints respect the local date for users when categorizing drives by day.
Please let me know if you need further clarification or have any additional questions.