We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In [1]: import pandas as pd In [2]: pd.Timestamp.fromtimestamp(1535097720.0).timestamp() Out[2]: 1535126520.0
the input is:1535097720.0 and the output is:1535126520.0
It seems pd.Timestamp use the local time zone to format the time and then treat it as UTC+0,but it's wrong.
in version 0.21.0, it works:
In [56]: pd.Timestamp.fromtimestamp(1535097720.0).timestamp() Out[56]: 1535097720.0
The text was updated successfully, but these errors were encountered:
It's like pandas will automatic set timezone to your local timezone. In my location, this behave like:
In [5]: pd.Timestamp.fromtimestamp(0).timestamp() Out[5]: 28800.0
28800 = 8 * 60 * 60, which means UTC+8. So you should do:
In [8]: pd.Timestamp.utcfromtimestamp(0).timestamp() Out[8]: 0.0
Hoo, it works!
Sorry, something went wrong.
@Ko-Han I think this is confused,timestamp should not related with timezone.
It is just:
the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC) Thursday, 1 January 1970
So we could compare the timestamp in different timezone.
And I think the behavior is right in 0.21.0
Duplicate of #22450.
No branches or pull requests
the input is:1535097720.0 and the output is:1535126520.0
It seems pd.Timestamp use the local time zone to format the time and then treat it as UTC+0,but it's wrong.
in version 0.21.0, it works:
The text was updated successfully, but these errors were encountered: