我想聲明的變量包含日期時間的這樣錯誤 - 「SQLite DateTime類型只接受Python」「datetime和date對象作爲輸入。」
ts1.departure_date = '2012-03-03 10:10:10'
但後來我得到這個錯誤
StatementError: (exceptions.TypeError) SQLite DateTime type only accepts Python datetime and date objects as input.
我不知道什麼是宣佈與datetime格式的變量的正確方法是什麼?在此先感謝
你試過:'ts1.departure_date = datetime(2012,3,3,10,10,10)'? –
@Joe Clements:寫作答案,將upvote – knitti
@JonClements我試着像你說的和導入日期時間,但然後我得到這個錯誤TypeError:'模塊'對象不可調用,任何想法?謝謝 – wiko