Skip to content

Carry a time that rounds up to midnight into the next day - #88

Merged
borgar merged 2 commits into
borgar:masterfrom
rashoodz:fix-midnight-carry
Oct 5, 2026
Merged

borgar merged 2 commits into
borgar:masterfrom
rashoodz:fix-midnight-carry

Conversation

@rashoodz

@rashoodz rashoodz commented Oct 5, 2026

Copy link
Copy Markdown

A time that rounds up to midnight shows 0:00 on the original date.

Pattern Value Excel numfmt 3.2.6
m/d/yy h:mm 45292.9999999 1/2/24 0:00 1/1/24 0:00
yyyy-mm-dd hh:mm:ss 45292.999995 2024-01-02 00:00:00 2024-01-01 00:00:00

Rounding the seconds could reach a full day without moving the date, and the calendar date was always read from the unrounded serial. The day now carries after rounding when the pattern shows a time, and the date is read from the carried day. A pattern showing only a date still drops the time (m/d/yy of 45292.9999999 stays 1/1/24).

🤖 Generated with Claude Code

@borgar
borgar merged commit 8646a79 into borgar:master Oct 5, 2026
3 checks passed
@borgar

borgar commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Thank you for this. These are nice finds. 🙏

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