Skip to content

Fix incorrect formatting of negative timestamps - #1508

Merged
Delgan merged 1 commit into
masterfrom
fix-1501
Aug 29, 2026
Merged

Delgan merged 1 commit into
masterfrom
fix-1501

Conversation

@Delgan

@Delgan Delgan commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Fix #1501.

The issue only mentions {:x} formatting (microsecond timestamps), but the fix also applies to {:X} (second timestamps). I don't think POSIX defines the expected behavior in this case, but floor() is preferable and more consistent, as it avoids having two different seconds (immediately before and after the epoch) both return 0 as the timestamp.

@Delgan
Delgan merged commit 5672e7d into master Aug 29, 2026
40 of 42 checks passed
@Delgan
Delgan deleted the fix-1501 branch August 29, 2026 18:14
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.

{time:x} is incorrect for negative timestamps due to toward-zero truncation

1 participant