-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: Parse %z and %Z directive in format for to_datetime #19979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
4a43815
DOC: update the Index.isin docstring (#20249)
noemielteto cb47c08
ENH: Parse %z directive in format for to_datetime
mroeschke f299aec
move parsing to a sub function, add additional test
mroeschke 259ec8f
Address comments
mroeschke 77af4db
timezone compat
mroeschke 54c2491
add empty line for strptime.pyx
mroeschke 0e2a0cd
add issue number and try except
mroeschke d31e141
Merge remote-tracking branch 'upstream/master' into strftime_timezone
mroeschke 7bdbdf4
Merge remote-tracking branch 'upstream/master' into strftime_timezone
mroeschke 3e3d5c6
add whatsnew
mroeschke c16ef8c
Merge remote-tracking branch 'upstream/master' into strftime_timezone
mroeschke 6f0b7f0
remove weird pd file
mroeschke 0525823
Merge remote-tracking branch 'upstream/master' into strftime_timezone
mroeschke 4c22808
Remove blank line
mroeschke 24e1c0a
Merge remote-tracking branch 'upstream/master' into strftime_timezone
mroeschke 4f2f865
Merge remote-tracking branch 'upstream/master' into strftime_timezone
mroeschke 145e5da
Merge remote-tracking branch 'upstream/master' into strftime_timezone
mroeschke 64bc3fc
Use pytz zones only
mroeschke 47a9d69
Merge remote-tracking branch 'upstream/master' into strftime_timezone
mroeschke 1b44554
Rework test to only expect pytz after parsing
mroeschke 0dcc59f
Merge remote-tracking branch 'upstream/master' into strftime_timezone
mroeschke 149781b
Merge remote-tracking branch 'upstream/master' into strftime_timezone
mroeschke d99ef5a
Clean up and flake8 fix
mroeschke 0e5e3c6
Merge remote-tracking branch 'upstream/master' into strftime_timezone
mroeschke 9a2ea19
Add additional unbalanced colon test
mroeschke 924859e
Merge remote-tracking branch 'upstream/master' into strftime_timezone
mroeschke a1599a0
allow parsing of any pytz
mroeschke 6c80c2e
Merge remote-tracking branch 'upstream/master' into strftime_timezone
mroeschke abccc3e
move error handling
mroeschke 473a0f4
Lint
mroeschke ab0a692
Small cleanup
mroeschke 56fc683
Lint
mroeschke 85bd45e
Merge remote-tracking branch 'upstream/master' into strftime_timezone
mroeschke eb2a661
Add additional test and move whatsnew to v0.24
mroeschke 5500ca8
Merge remote-tracking branch 'upstream/master' into strftime_timezone
mroeschke 0e0d0fd
Merge remote-tracking branch 'upstream/master' into strftime_timezone
mroeschke 34f638c
Merge remote-tracking branch 'upstream/master' into strftime_timezone
mroeschke 757458d
Add comment that FixedOffset(0) is UTC
mroeschke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this also work with
%Z
?It seems that with
datetime.datetime.strptime
it does not work with eitherThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex I pulled from https://github.com/python/cpython/blob/master/Lib/_strptime.py has an option for 'Z' with
%z
:https://github.com/python/cpython/blob/483000e164ec68717d335767b223ae31b4b720cf/Lib/_strptime.py#L204
But
%Z
only makes timezones found in the system local time available, i.e. no 'Z' option.https://github.com/python/cpython/blob/483000e164ec68717d335767b223ae31b4b720cf/Lib/_strptime.py#L210-L212
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK (that's probably a newer addition to python), then it makes sense to follow upstream python to be consistent