Skip to content

carry field normalization into parsed year in ParseYearAnd#2109

Closed
nabhan06 wants to merge 1 commit into
abseil:masterfrom
nabhan06:civil-time-year-carry
Closed

carry field normalization into parsed year in ParseYearAnd#2109
nabhan06 wants to merge 1 commit into
abseil:masterfrom
nabhan06:civil-time-year-carry

Conversation

@nabhan06

Copy link
Copy Markdown
Contributor

Dropped year carry in ParseCivilTime

ParseYearAnd parses the year on its own and normalizes it into the ~2400 range before handing the rest of the string to ParseTime, then rebuilds the result from the original year plus the normalized month..second fields taken from cs. When one of those fields carries across the year boundary (a :60 leap second at 23:59:60 on Dec 31, or an end-of-year rollover), that carry lives in cs.year() and was dropped, so ParseCivilTime("2020-12-31T23:59:60") produced 2020-01-01T00:00:00 while constructing CivilSecond(2020, 12, 31, 23, 59, 60) directly gives 2021-01-01T00:00:00. This reapplies the same carry to the original year, which is a no-op whenever no rollover happened.

@derekmauro derekmauro self-assigned this Jul 17, 2026
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