You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Something changed with pandas.to_datetime() in pandas 2.x and timestamps are now parsing incorrectly if they're passed as a unix timestamp string and units='s'.
There's a deprecation warning about behavior changing in a future version but it appears to be broken in all 2.x releases (reproduced locally on 2.0.0 and 2.2.1).
Expected Behavior
Unix timestamps should continue parse consistently when passed as a str or int until the future version that changes the default behavior.
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
Passing a unix timestamp as a string with
unit='s'
parses the wrong timestamp. Passing it as an integer works as expected.Issue Description
Something changed with
pandas.to_datetime()
in pandas 2.x and timestamps are now parsing incorrectly if they're passed as a unix timestamp string andunits='s'
.There's a deprecation warning about behavior changing in a future version but it appears to be broken in all 2.x releases (reproduced locally on 2.0.0 and 2.2.1).
Expected Behavior
Unix timestamps should continue parse consistently when passed as a
str
orint
until the future version that changes the default behavior.This does work as expected in the 1.5.3 release:
Installed Versions
The text was updated successfully, but these errors were encountered: