Skip to content

string to date format ignored on apply #3669

Closed
@hayd

Description

@hayd

From the So question.

I think apply be passing on the format keyword argument:

In [1]: s = pd.Series(['12/1/2012', '30/01/2012'])

In [2]: s.apply(pd.to_datetime, format='%d/%m/%Y')
Out[2]:
0   2012-12-01 00:00:00
1   2012-01-30 00:00:00
dtype: datetime64[ns]

In [3]: pd.to_datetime(s, format='%d/%m/%Y')
Out[3]:
0   2012-01-12 00:00:00
1   2012-01-30 00:00:00
dtype: datetime64[ns]

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIO DataIO issues that don't fit into a more specific label

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions