Skip to content

BUG: timestamp value is different with pd.Timestamp and regular python datetime (tz naive with same value) #60425

@nicknolt

Description

@nicknolt

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

import pandas as pd

ori_ts = 1719850245.23
pd_date = pd.Timestamp(ori_ts, unit='s')
py_date = pd_date.to_pydatetime()

pd_ts = pd_date.timestamp()
py_ts = py_date.timestamp()

delta = abs(pd_ts - py_ts)

print(delta)

Issue Description

with the same tz and time values the given timestamp is not the same.
I'm in France and the delta between both is 7200 seconds corresponding to the GMT+2 tz

Expected Behavior

In the documentation pd.Timestamp will behave like the datetime, i was expecting to have the same value

Installed Versions

I have installed the 2.2.2 version and i have tried with older version and also with the 1.x version and the result is the same

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugNeeds TriageIssue that has not been reviewed by a pandas team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions