Skip to content

BUG: pd.to_datetime with low-reso unit and high-reso origin #63419

Description

@jbrockmendel

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

ts = pd.Timestamp("2016-01-01 00:00:00.000001")
dti = pd.to_datetime([1, 2, 3], unit="D", origin=ts)

>>> dti
DatetimeIndex(['2016-01-02', '2016-01-03', '2016-01-04'], dtype='datetime64[ns]', freq=None)

Issue Description

@jorisvandenbossche pointed this out in #63347, but it turns out to be a problem on main too.

Expected Behavior

dti
DatetimeIndex(['2016-01-02 00:00:00.01', '2016-01-03 00:00:00.01', '2016-01-04 00:00:00.01'], dtype='datetime64[ns]', freq=None)

Installed Versions

Details

Replace this line with the output of pd.show_versions()

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugTimestamppd.Timestamp and associated methods

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions