Use %z directive in parse_datetime
authorHarmon <Harmon758@gmail.com>
Fri, 25 Feb 2022 20:52:31 +0000 (14:52 -0600)
committerHarmon <Harmon758@gmail.com>
Fri, 25 Feb 2022 20:52:31 +0000 (14:52 -0600)
tweepy/utils.py

index 4eec41afb191e6aacc71c46331766603bdee7bb1..9e17a16cab5c527b3caf4f9348eb7b5e8e164689 100644 (file)
@@ -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