c.execute('insert into foo values(?, ?)', (42, datetime.datetime.now() +
    datetime.timedelta(-1)))
c.execute('select bar, baz as "ts [timestamp]" from foo')
print(c.fetchall())
c.execute('select max(baz) as "ts [timestamp]" from foo')
print(c.fetchall())
Reading back a datetime in sqlite3