Skip to content

Commit 8209598

Browse files
committed
SDK-1260: Fix rounding error in datetime parser causing time to be out
by 1 microsecond
1 parent 45aee6b commit 8209598

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

yoti_python_sdk/date_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def datetime_with_microsecond(string):
3434
hour = int(time_split[3])
3535
minute = int(time_split[4])
3636
second = int(time_split[5])
37-
microsecond = int(float("0." + time_split[6]) * 1e6)
37+
microsecond = int(round(float("0." + time_split[6]) * 1e6))
3838
return datetime(year, month, day, hour, minute, second, microsecond)
3939
except ValueError:
4040
if logging.getLogger().propagate:

0 commit comments

Comments
 (0)