Python3.7转换以逗号分隔的日期时间

时间:2019-12-27 20:33:28

标签: python python-3.x python-3.7 python-datetime

我正在阅读Postgresql数据库中的日期列。我想将其从下面的读数转换为YYYY-MM-DD(这是它最初输入数据库的方式)。 最好的方法是什么?

代码:

dataReading = cursor.fetchall()
print(dataReading[1])

输出:

(datetime.date(2016, 1, 5),)

0 个答案:

没有答案
相关问题