mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #14720: sqlite3: Convert datetime microseconds correctly
Patch by Lowe Thiderman
This commit is contained in:
parent
ed909bcbdd
commit
8b945148e3
4 changed files with 23 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue