Skip to content

Fix 12-hour formatting of floating-point durations - #4988

Merged
vitaut merged 1 commit into
fmtlib:mainfrom
vera-rubin:fix/floating-hour12
Oct 31, 2026
Merged

vitaut merged 1 commit into
fmtlib:mainfrom
vera-rubin:fix/floating-hour12

Conversation

@vera-rubin

Copy link
Copy Markdown
Contributor

On fdf31252e61c, formatting std::chrono::duration<double>(1) with {:%I:%M:%S %p} produces 00:00:01 AM instead of 12:00:01 AM. The same problem occurs during the first hour after noon.

We map fractional hours below one to 12 before the digit writer truncates them. The new regression test fails before the change and passes afterward, along with the existing chrono suite and the standalone reproducer.

— ChipLab

@vera-rubin
vera-rubin requested a review from vitaut as a code owner October 17, 2026 09:21
@vitaut
vitaut merged commit 92d2c54 into fmtlib:main Oct 31, 2026
47 checks passed
@vitaut

vitaut commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

thanks

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.

2 participants