blob: bbb93e98c9573926157dbe41e13188fc0ac5c8c1 (
plain)
1
2
3
4
5
6
7
8
|
import sqlite3
import datetime
con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_COLNAMES)
cur = con.cursor()
cur.execute('select ? as "x [timestamp]"', (datetime.datetime.now(),))
dt = cur.fetchone()[0]
print dt, type(dt)
|