Skip to content

Commit 20e1460

Browse files
author
Sixto Martin
committed
Merge pull request #18 from obmarg/decimal-date-fix
Added support for dates with milliseconds
2 parents 52abf76 + 0cdaff8 commit 20e1460

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

onelogin/saml/Response.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ def __init__(
5858
self._signature = signature
5959

6060
def _parse_datetime(self, dt):
61-
return datetime.strptime(dt, '%Y-%m-%dT%H:%M:%SZ')
61+
try:
62+
return datetime.strptime(dt, '%Y-%m-%dT%H:%M:%SZ')
63+
except ValueError:
64+
return datetime.strptime(dt, '%Y-%m-%dT%H:%M:%S.%fZ')
6265

6366
def _get_name_id(self):
6467
result = self._document.xpath(

0 commit comments

Comments
 (0)