Skip to content

fix(cli): display timestamps in local time instead of UTC#2107

Open
benoitf wants to merge 1 commit into
NVIDIA:mainfrom
benoitf:date-iso8601
Open

fix(cli): display timestamps in local time instead of UTC#2107
benoitf wants to merge 1 commit into
NVIDIA:mainfrom
benoitf:date-iso8601

Conversation

@benoitf

@benoitf benoitf commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Display sandbox and provider timestamps in the user's local timezone instead of UTC, fixing a visual drift where creation times appeared hours in the past for non-UTC users
  • Use ISO 8601 with timezone offset for JSON output (--output json)
  • Apply the same fix to the TUI timestamp display

Related Issue

Closes #2106

Changes

  • crates/openshell-cli/src/run.rs: Replace format_epoch_ms manual UTC arithmetic with chrono::Local for YYYY-MM-DD HH:MM:SS local-time display. Add format_epoch_ms_iso8601 for JSON output (2026-07-01T16:56:41+02:00). Replace format_timestamp_ms (audit log) similarly. Remove civil_from_days helper. Update JSON call sites in sandbox_to_json and provider_to_json to use ISO 8601.
  • crates/openshell-tui/src/lib.rs: Replace format_timestamp with chrono::Local. Remove days_to_ymd helper. format_age (relative time) is unchanged — it was already correct.
  • crates/openshell-tui/Cargo.toml: Add chrono = "0.4" dependency.

Testing

  • mise run pre-commit passes (markdown lint failures are pre-existing untracked files)
  • All 185 CLI unit tests pass, including 3 updated timestamp tests
  • TUI compiles cleanly
  • Manual: openshell sandbox list — CREATED column matches local clock
  • Manual: openshell sandbox list --output jsoncreated_at uses ISO 8601 with offset

Checklist

@copy-pr-bot

copy-pr-bot Bot commented Jul 1, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Closes NVIDIA#2106

Signed-off-by: Florent Benoit <fbenoit@redhat.com>
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.

bug: Sandbox timestamps display UTC instead of local time, causing 2-hour drift

1 participant