From dc846b5392f37b00261710d4441068587e93951d Mon Sep 17 00:00:00 2001 From: mirafranc <36648808+mirafranc@users.noreply.github.com> Date: Fri, 13 Nov 2020 12:34:11 +0100 Subject: [PATCH] Update __init__.py Fixes #175 --- jaydebeapi/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jaydebeapi/__init__.py b/jaydebeapi/__init__.py index a890c3d..a1ce697 100644 --- a/jaydebeapi/__init__.py +++ b/jaydebeapi/__init__.py @@ -621,7 +621,7 @@ def _to_datetime(rs, col): if not java_val: return d = datetime.datetime.strptime(str(java_val)[:19], "%Y-%m-%d %H:%M:%S") - d = d.replace(microsecond=int(str(java_val.getNanos())[:6])) + d = d.replace(microsecond=int(str(java_val.getNanos()).zfill(9)[:6])) return str(d) def _to_time(rs, col):