ENH: Support non-nano inference in to_datetime (original) (raw)
Feature Type
- Adding new functionality to pandas
- Changing existing functionality in pandas
- Removing existing functionality in pandas
Problem Description
In [1]: import pandas as pd
In [2]: pd.to_datetime("1677-01-01 00:00:00") OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 1677-01-01 00:00:00, at position 0
In [3]: pd.Timestamp("1677-01-01 00:00:00") Out[3]: Timestamp('1677-01-01 00:00:00')
Feature Description
It would be great if to_datetime would perform unit inference like Timestamp.
Looks mainly an issue with array_to_datetime still assuming ns resolution for strings
Alternative Solutions
Use Timestamp
Additional Context
No response