Skip to content

Convert string time to timestamp. #13111

@Milad137

Description

@Milad137

I have a csv file with datetime formatted as "%d/%m/%Y %I:%M %p". I can convert them to pandas datetime but when I use pyarrow's strptime I get the following error.
ArrowInvalid: Failed to parse string: '9/03/2043 12:35 AM' as a scalar of type timestamp[s]

Code to reproduce:

import pandas as pd
import pyarrow.compute as pc

# pd.__version__ == '1.3.4'
# pyarrow.__version__ == '8.0.0'

_ts = ["9/03/2043 12:35 AM"]
_format = "%d/%m/%Y %I:%M %p"

pd.to_datetime(_ts, format=_format)
pc.strptime(_ts, format= _format, unit='s')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions