We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13cf194 commit 8d8bf07Copy full SHA for 8d8bf07
minio/parsers.py
@@ -360,7 +360,14 @@ def _iso8601_to_localized_time(date_string):
360
:param date_string: iso8601 formatted date string.
361
:return: :class:`datetime.datetime`
362
"""
363
- parsed_date = datetime.strptime(date_string, '%Y-%m-%dT%H:%M:%S.%fZ')
+
364
+ # Handle timestamps with and without fractional seconds. Some non-AWS
365
+ # vendors (e.g. Dell EMC ECS) are not consistent about always providing
366
+ # fractional seconds.
367
+ try:
368
+ parsed_date = datetime.strptime(date_string, '%Y-%m-%dT%H:%M:%S.%fZ')
369
+ except ValueError:
370
+ parsed_date = datetime.strptime(date_string, '%Y-%m-%dT%H:%M:%SZ')
371
localized_time = pytz.utc.localize(parsed_date)
372
return localized_time
373
0 commit comments