Discussions

Ask a Question
Back to All

API v2 Attendance entries lack UTC times

An Attendance as returned by v2/attendance-periods contain the start and end of the attendance entry only in local time. This makes it impossible to always calculate the duration of the entry as there are edge cases with summer time/daylight saving time.

Example

The user works in timezone Europe/Berlin which does the change from CET to CEST at 2025-03-30T02:00:00+01:00

If the user happens to work at that time, their attendance entry might look like this:

{
  [...].
  "type": "WORK",
  "start": { "date_time": "2025-03-30T01:00:00" },
  "end": { "date_time": "2025-03-30T04:00:00" },
  [...]
}

Without any further information, it looks like the attendance entry has a duration of 3 hours, while infact, due to the clock jumping from 02:00:00+01:00 (CET) to 03:00:00+02:00 (CEST), the actual duration (as correctly displayed in the Web UI) is 2 hours.

Proposal

Beside the date_time field in start and end, add a field containing the time as UTC or including UTC-diff

{
  [...].
  "type": "WORK",
  "start": { "date_time": "2025-03-30T01:00:00", "date_time_utc": "2025-03-30T00:00:00Z" },
  "end": { "date_time": "2025-03-30T04:00:00", "date_time_utc": "2025-03-30T02:00:00Z" },
  [...]
}