Issue #14720: sqlite3: Convert datetime microseconds correctly

Patch by Lowe Thiderman
This commit is contained in:
Petri Lehtinen 2013-02-23 19:05:09 +01:00
parent ed909bcbdd
commit 8b945148e3
4 changed files with 23 additions and 2 deletions

View file

@ -67,7 +67,7 @@ def register_adapters_and_converters():
timepart_full = timepart.split(b".")
hours, minutes, seconds = map(int, timepart_full[0].split(b":"))
if len(timepart_full) == 2:
microseconds = int(timepart_full[1])
microseconds = int('{:0<6}'.format(timepart_full[1].decode()))
else:
microseconds = 0