Add conversions for chrono's Local timezone#5174
Merged
bschoenmaeckers merged 1 commit intoPyO3:mainfrom Jun 3, 2025
Merged
Conversation
c35d3a3 to
6bb67b3
Compare
davidhewitt
approved these changes
Jun 2, 2025
Member
davidhewitt
left a comment
There was a problem hiding this comment.
Thanks, I guess I will ship this in 0.25.1 given that users sort of had this before we fixed the conversions to not just make fixed offsets everywhere.
6bb67b3 to
eff5ab7
Compare
davidhewitt
pushed a commit
that referenced
this pull request
Jun 11, 2025
davidhewitt
pushed a commit
that referenced
this pull request
Jun 12, 2025
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.
This add
IntoPyObject&FromPyObjectimplementations forDateTime<Local>. It will create datetime instances with aZoneInfobound to the local iana name. Furthermore when converting into rust it will validate it has the same timezone. This currently does not handle naive python datetimes and will throw a exception when it does not match (or contains) the local timezone.closes #5169