The time difference of pandas.Timestamp is 8 hours, how to solve the problem of time zone?

 ~\Desktop 
 ip
Python 3.6.7rc2 (v3.6.7rc2:4893861ab5, Oct 13 2018, 17:34:23) [MSC v.1900 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information
IPython 7.2.0 -- An enhanced Interactive Python. Type "?" for help.

In [1]: import pandas as pd

In [2]: ts = pd.Timestamp(2017,6,19)

In [3]: ts
Out[3]: Timestamp("2017-06-19 00:00:00")

In [4]: tss = ts.timestamp()

In [5]: tss
Out[5]: 1497830400.0

In [6]: from datetime import datetime

In [7]: datetime.fromtimestamp(tss)
Out[7]: datetime.datetime(2017, 6, 19, 8, 0)

In [8]:

that"s it, very simple code. The solution now is to subtract 8 hours after finding timestamp. Is there any other solution?

Apr.21,2022

provides tz_localize and tz_convert functions in Pandas, where the former is used to convert timestamps to local time, while the latter can be used for conversion in any time zone.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e889cb-6865d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e889cb-6865d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?