Skip to content

Instantly share code, notes, and snippets.

@rgpower
Last active June 13, 2021 18:42
Show Gist options
  • Save rgpower/3a9afcb0df4fd140dab8a72efeff43e7 to your computer and use it in GitHub Desktop.
Save rgpower/3a9afcb0df4fd140dab8a72efeff43e7 to your computer and use it in GitHub Desktop.
parse iso8601 '2019-11-26T18:26:19Z' format string in python
"""
parse iso8601 '2019-11-26T18:26:19Z' format string in python
"""
def from_iso8601(datetime_iso: str):
return datetime.datetime.strptime(datetime_iso, "%Y-%m-%dT%H:%M:%S%z")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment