From: Harmon Date: Fri, 25 Feb 2022 20:52:31 +0000 (-0600) Subject: Use %z directive in parse_datetime X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=50bd3ae1cac853d34d29c697573ccf8a3fc4cd96;p=tweepy.git Use %z directive in parse_datetime --- diff --git a/tweepy/utils.py b/tweepy/utils.py index 4eec41a..9e17a16 100644 --- a/tweepy/utils.py +++ b/tweepy/utils.py @@ -12,6 +12,5 @@ def list_to_csv(item_list): def parse_datetime(datetime_string): return datetime.datetime.strptime( - datetime_string, "%Y-%m-%dT%H:%M:%S.%fZ" + datetime_string, "%Y-%m-%dT%H:%M:%S.%f%z" ).replace(tzinfo=datetime.timezone.utc) - # Use %z when support for Python 3.6 is dropped