-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Inconsistent date parsing of to_datetime #42908
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
Changes from 26 commits
8381574
12a36d8
0ee3428
9f1f7c9
67e9d95
390969f
9ee56ac
0744ced
56867d4
e6557c7
ee6fbde
15797a8
07834ed
b4bb5b3
1d08ae9
c4c87bc
c4e282d
44a0533
5362670
6b43118
700881d
bd893a2
11049a6
f6c44da
8969a8e
b6cbb5d
c26b7c1
c768e1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -701,8 +701,15 @@ def to_datetime( | |
Specify a date parse order if `arg` is str or its list-likes. | ||
If True, parses dates with the day first, eg 10/11/12 is parsed as | ||
2012-11-10. | ||
Warning: dayfirst=True is not strict, but will prefer to parse | ||
with day first (this is a known bug, based on dateutil behavior). | ||
|
||
.. warning:: | ||
|
||
dayfirst=True is not strict, but will prefer to parse | ||
with day first (this is a known bug, based on dateutil behavior). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i wouldn't say this is a known bug unless you can point to an authoritative reference. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't add this, it's from #7599 , I just put it into a warning block. Reckon it should be removed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah +1 to remove this line unless we can link the Github issue number. |
||
If a date string cannot be parsed in accordance with the given | ||
`dayfirst` option (e.g. ``to_datetime(['31-12-2021'], dayfirst=False)``) | ||
then in the case of delimited date strings, a warning will be shown. | ||
|
||
yearfirst : bool, default False | ||
Specify a date parse order if `arg` is str or its list-likes. | ||
|
||
|
@@ -711,8 +718,11 @@ def to_datetime( | |
- If both dayfirst and yearfirst are True, yearfirst is preceded (same | ||
as dateutil). | ||
|
||
Warning: yearfirst=True is not strict, but will prefer to parse | ||
with year first (this is a known bug, based on dateutil behavior). | ||
.. warning:: | ||
|
||
yearfirst=True is not strict, but will prefer to parse | ||
with year first (this is a known bug, based on dateutil behavior). | ||
|
||
utc : bool, default None | ||
Return UTC DatetimeIndex if True (converting any tz-aware | ||
datetime.datetime objects as well). | ||
|
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.
can you also add to the documentation itself, e.g. somewhere in
timeseries.rst
is appropriate