[issue29099] sqlite3 timestamp converter cannot handle timezone
Xiang Zhang
report at bugs.python.org
Thu Dec 29 05:38:36 EST 2016
Xiang Zhang added the comment:
import sqlite3, datetime
c = sqlite3.connect(':memory:', detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES)
cur = c.cursor()
cur.execute('create table test(t timestamp)')
t = datetime.datetime.now(tz=datetime.timezone.utc)
cur.execute("insert into test(t) values (?)", (t,))
cur.execute('select t from test')
l = cur.fetchone()[0]
t == l # the result not equal to the original one
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29099>
_______________________________________
More information about the Python-bugs-list
mailing list