fix: use ISO 8601 format for log timestamps [AI generated]#1663
Open
jsquyres wants to merge 1 commit into
Open
fix: use ISO 8601 format for log timestamps [AI generated]#1663jsquyres wants to merge 1 commit into
jsquyres wants to merge 1 commit into
Conversation
Change log timestamps from the custom format to ISO 8601 with UTC
indicator:
Before: 2026-05-14 (10:31:47) | DEBUG: ...
After: 2026-05-14T10:31:47Z | DEBUG: ...
The previous format used parentheses around the time and omitted any
timezone indicator, making timestamps ambiguous. The logger uses
std::chrono::system_clock which measures time since Unix epoch (UTC
on all platforms), but the old format did not communicate this.
ISO 8601 with the Z suffix is an unambiguous, universally-recognized
format parseable by standard functions across languages:
- C++ (C++20): std::chrono::from_stream(ss, "%FT%TZ", tp)
- C: strptime(s, "%Y-%m-%dT%H:%M:%SZ", &tm)
- Python: datetime.fromisoformat("2026-05-14T10:31:47Z")
This matters for correlating btop log events with system logs (e.g.,
macOS pmset power events) that use local time with explicit timezone
offsets.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a drive-by / minor suggestion that I came across while working on #1662: clarify that the timestamps in the btop logs are UTC (not local time), so that it's unambiguous how to reconcile btop log timestamps against system logs.
Change log timestamps from the custom format to ISO 8601 with UTC indicator:
Before:
2026-05-14 (10:31:47) | DEBUG: ...After:
2026-05-14T10:31:47Z | DEBUG: ...The previous format used parentheses around the time and omitted any timezone indicator, making timestamps ambiguous. The logger uses
std::chrono::system_clockwhich measures time since Unix epoch (UTC on all platforms), but the old format did not communicate this.ISO 8601 with the Z suffix is an unambiguous, universally-recognized format parseable by standard functions across languages:
std::chrono::from_stream(ss, "%FT%TZ", tp)strptime(s, "%Y-%m-%dT%H:%M:%SZ", &tm)datetime.fromisoformat("2026-05-14T10:31:47Z")This matters for correlating btop log events with system logs (e.g., macOS pmset power events) that use local time with explicit timezone offsets.