0
我在Python中使用SQLite3模塊,並且當前有一個表將「date」存儲爲datetime。然而,每當我試圖從表中檢索該日期,並將它與今天的日期(如今天= datetime.datetime.today()),我得到一個錯誤,指出:[TypeError:不能比較datetime.datetime元組]:如何使用Python和SQLite3比較元組值與日期時間值?
if row > today:
TypeError: can't compare datetime.datetime to tuple"
這裏
for row in con.execute('select time_date as "d [datetime]" from fault_record'):
if row < today:
print row
我難倒就如何元組日期轉換爲datetime:那我有麻煩的代碼片段?
謝謝!