[System] Fixed typo in utils

This commit is contained in:
Ferdinand Thiessen 2020-11-02 13:38:52 +01:00
parent 22499b7ece
commit 79c05fa2f4
1 changed files with 1 additions and 1 deletions

View File

@ -7,5 +7,5 @@ def from_iso_format(date_str):
"""Z-suffix aware version of `datetime.datetime.fromisoformat`"""
time = datetime.datetime.fromisoformat(date_str.replace('Z', '+00:00'))
if time.tzinfo:
return time.astimezone(tzinfo=datetime.timezone.utc)
return time.astimezone(datetime.timezone.utc)
return time.replace(tzinfo=datetime.timezone.utc)