summaryrefslogtreecommitdiffstats
path: root/Lib/sqlite3/dbapi2.py
diff options
context:
space:
mode:
authorPetri Lehtinen <petri@digip.org>2013-02-23 18:05:09 (GMT)
committerPetri Lehtinen <petri@digip.org>2013-02-23 18:05:09 (GMT)
commit9e14755b46c48207b44be92093ca2eae6ba22fac (patch)
tree1bbb90a9c86258902251605e9f64a7e841334376 /Lib/sqlite3/dbapi2.py
parentc23178ba36097764bc3c1c33aa8dba2a0871e778 (diff)
downloadcpython-9e14755b46c48207b44be92093ca2eae6ba22fac.zip
cpython-9e14755b46c48207b44be92093ca2eae6ba22fac.tar.gz
cpython-9e14755b46c48207b44be92093ca2eae6ba22fac.tar.bz2
Issue #14720: sqlite3: Convert datetime microseconds correctly
Patch by Lowe Thiderman
Diffstat (limited to 'Lib/sqlite3/dbapi2.py')
-rw-r--r--Lib/sqlite3/dbapi2.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/sqlite3/dbapi2.py b/Lib/sqlite3/dbapi2.py
index 7eb28e8..be7a50a 100644
--- a/Lib/sqlite3/dbapi2.py
+++ b/Lib/sqlite3/dbapi2.py
@@ -68,7 +68,7 @@ def register_adapters_and_converters():
timepart_full = timepart.split(".")
hours, minutes, seconds = map(int, timepart_full[0].split(":"))
if len(timepart_full) == 2:
- microseconds = int(timepart_full[1])
+ microseconds = int('{:0<6}'.format(timepart_full[1].decode()))
else:
microseconds = 0