You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ValueError: time data '2022-04-01T23:53:21.000Z' does not match format '%Y-%m-%dT%H:%M:%S.%f%z'
So the response does not match the given format, is this piece of code of utils.py outdated? Or has this issue already been solved?
Thanks in advance
Following issue occurs when requesting tweets in a specific timeframe
<ipython-input-76-51d491f82013> in <module>
9 end_time = '2022-04-02T00:00:00Z'
10
---> 11 tweets_v2 = client.search_recent_tweets(query=query, tweet_fields=['context_annotations', 'created_at'], start_time=start_time, end_time=end_time, max_results=10)
12
13 for tweet_v2 in tweets_v2.data:
~\anaconda3\envs\gpu\lib\site-packages\tweepy\client.py in search_recent_tweets(self, query, user_auth, **params)
1253 "since_id", "sort_order", "start_time", "tweet.fields",
1254 "until_id", "user.fields"
-> 1255 ), data_type=Tweet, user_auth=user_auth
1256 )
1257
~\anaconda3\envs\gpu\lib\site-packages\tweepy\client.py in _make_request(self, method, route, params, endpoint_parameters, json, data_type, user_auth)
136
137 data = response.get("data")
--> 138 data = self._process_data(data, data_type=data_type)
139
140 includes = response.get("includes", {})
~\anaconda3\envs\gpu\lib\site-packages\tweepy\client.py in _process_data(self, data, data_type)
149 if data_type is not None:
150 if isinstance(data, list):
--> 151 data = [data_type(result) for result in data]
152 elif data is not None:
153 data = data_type(data)
~\anaconda3\envs\gpu\lib\site-packages\tweepy\client.py in <listcomp>(.0)
149 if data_type is not None:
150 if isinstance(data, list):
--> 151 data = [data_type(result) for result in data]
152 elif data is not None:
153 data = data_type(data)
~\anaconda3\envs\gpu\lib\site-packages\tweepy\tweet.py in __init__(self, data)
128 self.created_at = data.get("created_at")
129 if self.created_at is not None:
--> 130 self.created_at = parse_datetime(self.created_at)
131
132 self.entities = data.get("entities")
~\anaconda3\envs\gpu\lib\site-packages\tweepy\utils.py in parse_datetime(datetime_string)
13 def parse_datetime(datetime_string):
14 return datetime.datetime.strptime(
---> 15 datetime_string, "%Y-%m-%dT%H:%M:%S.%f%z"
16 ).replace(tzinfo=datetime.timezone.utc)
~\anaconda3\envs\gpu\lib\_strptime.py in _strptime_datetime(cls, data_string, format)
563 """Return a class cls instance based on the input string and the
564 format string."""
--> 565 tt, fraction = _strptime(data_string, format)
566 tzname, gmtoff = tt[-2:]
567 args = tt[:6] + (fraction,)
~\anaconda3\envs\gpu\lib\_strptime.py in _strptime(data_string, format)
360 if not found:
361 raise ValueError("time data %r does not match format %r" %
--> 362 (data_string, format))
363 if len(data_string) != found.end():
364 raise ValueError("unconverted data remains: %s" %
The text was updated successfully, but these errors were encountered:
ValueError: time data '2022-04-01T23:53:21.000Z' does not match format '%Y-%m-%dT%H:%M:%S.%f%z'
So the response does not match the given format, is this piece of code of utils.py outdated? Or has this issue already been solved?
Thanks in advance
Following issue occurs when requesting tweets in a specific timeframe
The text was updated successfully, but these errors were encountered: