Open utterances-bot opened 8 months ago
整理在 Python 中處理時區的問題,並如何自 SQLite 存取考慮時區的時間
https://blog.liang2.tw/posts/2015/09/datetime-sqlite/
整篇看完,還是有點不太懂,我用python3.9 + Sqlite3 是不是還是不能用.strftime(%H:%M:%S %Y-%m-%d)? 都只能存2015-09-29 12:48:16.671538 這樣
你可以採用非預設的時間格式,把它當成一般字串存取即可,然後自己處理字串、Python datetime 之間的轉換。
Datetime in SQLite and Python
整理在 Python 中處理時區的問題,並如何自 SQLite 存取考慮時區的時間
https://blog.liang2.tw/posts/2015/09/datetime-sqlite/