Skip to content

BUG: Inconsistent date parsing of month/year #10537

Closed
@kzielnicki

Description

@kzielnicki
>>> 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions