Commit Timestamp Display in Codecov UI Appears Off by Browser Time Zone
0 reputation · 14 Sept 2024, 10:36 UTC
0 reputation · 14 Sept 2024, 10:36 UTC
The Codecov web interface shows commit timestamps as relative times (e.g., “2 days ago”) that appear shifted when viewed from a non‑UTC browser. The underlying API returns ISO 8601 timestamps ending with a ‘Z’, indicating UTC, but the UI seems to apply the client’s local time zone to these values.
Codecov’s documentation provides no explicit guidance on whether the date range filter for the coverage history chart interprets the input dates as UTC or local dates, nor does it offer a setting to control time‑zone conversion for either the API or the UI.
1. Does the Codecov UI automatically convert UTC commit timestamps to the viewer’s local time zone when rendering relative times?
2. Is the date range filter on the coverage history chart interpreted as UTC dates or local dates, and how does this affect the plotted data?
3. Would a configuration option to override the default time‑zone behavior for commit timestamps or date ranges be possible or already planned?
33275 reputation · 14 Sept 2024, 16:27 UTC
1. Yes – the Codecov web UI treats the API‑returned UTC timestamps (ending in ‘Z’) as instants and converts them to the browser’s local time zone before displaying relative times such as “2 days ago”.
2. The date‑range filter on the coverage‑history chart accepts the dates you pick as local calendar dates; the frontend usually converts those local‑midnight values to UTC timestamps (ending in ‘Z’) before sending them to the API, so the plotted data reflects the range you selected in your own zone unless the backend re‑interprets them as UTC.
3. There is no documented UI setting or API flag to override this automatic local‑zone conversion; a timezone‑control feature would require a new feature request or custom plugin.
"committed_at":"2026-09-14T12:34:56Z").Date constructor (or a moment‑like library) parses the ‘Z’ suffix as UTC and then converts the instant to the local time zone for display.new Date(utcString) and then formatting the result with toLocaleString or a library that defaults to the browser’s zone.start_date and end_date parameters./api/v2/github/<user>/<repo>/commits). Note a timestamp field, e.g., "committed_at":"2026-09-14T12:34:56Z".new Date('2026-09-14T12:34:56Z').toLocaleString() and compare the output to the relative time shown in the UI (you may need to convert the relative label to an absolute time for comparison)./api/v2/github/<user>/<repo>/coverage). Verify that the start_date parameter is a UTC timestamp like 2026-09-10T00:00:00Z (local midnight converted to UTC).Does the observed offset remain constant for all commits, or does it vary with the date of the commit (e.g., due to daylight‑saving transitions)? If the offset varies, the issue is likely a DST‑handling bug in the UI’s date library; if it is constant, the behavior is simply the expected local‑zone conversion.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.