Skip to content

BUG: Inconsistent date parsing of month/year #10537

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

Closed
kzielnicki opened this issue Jul 9, 2015 · 2 comments · Fixed by #7599
Closed

BUG: Inconsistent date parsing of month/year #10537

kzielnicki opened this issue Jul 9, 2015 · 2 comments · Fixed by #7599
Labels
Bug Datetime Datetime data dtype
Milestone

Comments

@kzielnicki
Copy link

>>> pd.Timestamp('2014-06')
Timestamp('2014-06-01 00:00:00')
>>> pd.Timestamp('06-2014')
Timestamp('2014-06-09 00:00:00')

When parsing a string "YYYY-MM", the day defaults to the 1st of the month (the behavior I would expect, consistent with defaulting hour minute and second to 0), while "MM-YYYY" defaults the day to today's day. If the string format is specified manually as in pd.to_datetime('06-2014',format='%m-%Y'), the day consistently defaults to the first of the month.

@jreback
Copy link
Contributor

jreback commented Jul 11, 2015

This is fixed I believe by #7599

@jreback jreback added this to the 0.17.0 milestone Jul 11, 2015
@sinhrks
Copy link
Member

sinhrks commented Jul 11, 2015

Thanks for the report! Yes #7599 should solve this. I've added tests for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants