From 50bd3ae1cac853d34d29c697573ccf8a3fc4cd96 Mon Sep 17 00:00:00 2001 From: Harmon Date: Fri, 25 Feb 2022 14:52:31 -0600 Subject: [PATCH] Use %z directive in parse_datetime --- tweepy/utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 -- 2.25.1