将带有psycopg2.dt.fixedoffsettimezone的Python datetime.datetime转换为带有时区的熊猫时间戳

时间:2019-12-02 09:48:34

标签: python pandas postgresql timezone psycopg2

我正在使用PostgreSQL来存储带有时区信息的时间戳。使用pandas.read_sql()从python查询时,这些时间戳将作为datetime.datetime对象以psinfocopg2.dt.fixedoffsettimezone(...)的tzinfo返回。有什么方法可以将这些日期时间返回或有效地转换为熊猫时间戳,以便可以使用熊猫功能轻松地对其进行操作?

0 个答案:

没有答案