Repository navigation
Fix local minute boundaries for offsets containing seconds - #91
Open
mikamikasuki wants to merge 2 commits into
Open
mikamikasuki wants to merge 2 commits into
mikamikasuki wants to merge 2 commits into
Conversation
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.
BeginningOfMinuteuses absolute-time truncation, which produces the wrong local minute boundary when a zone offset contains seconds. For example, in Kathmandu in 1900,12:34:49becomes12:34:16;EndOfMinutethen extends into the next local minute.Remove the local seconds before truncating subsecond precision. This retains the input location and the selected occurrence of a repeated daylight-saving minute. If doing so crosses an offset change, retain the existing boundary for that partial minute.
Ten regression cases cover positive and negative second-based offsets, historical Kathmandu, an existing minute boundary, ordinary offsets, both occurrences of a repeated New York minute, and partial minutes around the Algiers offset change in 1891. Four cases fail before the fix, for both beginning and end boundaries.
Validation: full tests on Go 1.16.15, 1.23.12 and 1.27.1; race tests on 1.23 and 1.27; shuffled tests on 1.27; and
go vetpass. Golangci-lint reports no added findings; its three full-suite findings also occur on the base revision. Separate checks cover every second-based fixed offset within ±24 hours and historical IANA transition boundaries.Prepared with AI assistance.