Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
yoniaxonius committed May 10, 2023
1 parent 7635372 commit d09d11c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ldap3/protocol/formatters/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ def format_ad_timestamp(raw_value):
tz=utc_timezone) # forces true division in python 2
except (OSError, OverflowError, ValueError): # on Windows backwards timestamps are not allowed
try:
# The timestamp that is retunred from AD might be too big and this can cause this function
# to fail, so we are trimming any number after 17 characters
if len(str(timestamp)) > 17:
timestamp = f'{timestamp}'[:17]
timestamp = int(timestamp)
Expand Down

0 comments on commit d09d11c

Please sign in to comment.