Skip to content

Commit

Permalink
Stop checking Client request parameter name when converting to datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
Harmon758 committed Sep 29, 2021
1 parent 618d1c2 commit 1320a37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tweepy/client.py
Expand Up @@ -143,7 +143,7 @@ def _make_request(self, method, route, params={}, endpoint_parameters=None,

if isinstance(param_value, list):
request_params[param_name] = ','.join(map(str, param_value))
elif param_name in ("start_time", "end_time") and isinstance(param_value, datetime.datetime):
elif isinstance(param_value, datetime.datetime):
if param_value.tzinfo is not None:
param_value = param_value.astimezone(datetime.timezone.utc)
request_params[param_name] = param_value.strftime("%Y-%m-%dT%H:%M:%S.%fZ")
Expand Down

0 comments on commit 1320a37

Please sign in to comment.