Skip to content

fix: show absolute dates as UTC RFC 3339 everywhere - #72

Merged
radim10 merged 1 commit into
masterfrom
fix/utc-absolute-dates
Oct 10, 2026
Merged

radim10 merged 1 commit into
masterfrom
fix/utc-absolute-dates

Conversation

@radim10

@radim10 radim10 commented Oct 10, 2026

Copy link
Copy Markdown
Member

Summary

Absolute dates were shown in four different ways across the CLI. They now all use one format, UTC RFC 3339 with whole seconds and a Z (e.g. 2026-10-09T07:57:15Z), which matches what agent sessions already printed.

Where Before After
projects / environments / webhooks 2026-10-09 09:57 (local time, no zone) 2026-10-09T07:57:15Z (relative "x ago" kept in detail views)
secrets metadata (table/plain) 2026-09-13T11:53:59.237435+00:00 (raw API string) 2026-09-13T11:53:59Z
agent docker status / cleanup 2026-10-09 09:57:15.791491833 +0200 CEST (Go time.Time string) 2026-10-09T07:57:15Z
agent sessions 2026-09-13T11:53:59Z unchanged

Changes

  • utils/human_datetime.rs: shared format_utc / format_utc_timestamp (moved from agent/sessions.rs), plus display_utc_timestamp, which leaves values it can't parse (e.g. an empty last_accessed_at) unchanged. get_human_datetime now formats in UTC instead of Local.
  • Docker networks: created_at is read with {{json .Created}}, which works whether the Docker CLI exposes .Created as a time.Time or a string. It's normalized to UTC and falls back to Docker's raw value if it doesn't parse.

Notes

  • --json output from the REST API is unchanged; the API already returns UTC, and it's passed through as-is.
  • agent docker status --json created_at now uses the normalized UTC value instead of Docker's raw string.

Test plan

  • cargo fmt --check
  • cargo test (594 + 25 + 33 passed), including new tests for UTC formatting, local-timezone independence, the unparseable fallback, and Docker Created normalization
  • Checked {{json .Created}} against a real Docker network (CLI 28.5.1 / engine 29.4.0)

Projects, environments and webhooks rendered dates in local time with no
zone, secrets metadata printed raw API strings, and agent Docker networks
printed Go's time.Time string. All now go through one formatter
(`2026-10-09T07:57:15Z`), matching what `agent sessions` already showed.

Docker network times are read with `{{json .Created}}`, which works
whether the CLI exposes `.Created` as a string or a time.Time, and fall
back to Docker's raw value if it doesn't parse.
@radim10 radim10 self-assigned this Oct 10, 2026
@radim10
radim10 merged commit 39892e8 into master Oct 10, 2026
3 checks passed
@radim10
radim10 deleted the fix/utc-absolute-dates branch October 10, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant