From: Jacob Bremiller <48461435+jacob1421@users.noreply.github.com> Date: Thu, 27 Jan 2022 22:21:14 +0000 (-0600) Subject: Fixed date formatting for datetime objects X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=615476a2c039343284c973b615ef52d6bbd62c88;p=tweepy.git Fixed date formatting for datetime objects https://docs.tweepy.org/en/stable/client.html Required Format: YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339) Docs are already updated with correct details. "Please note that this parameter does not support a millisecond value." --- diff --git a/tweepy/client.py b/tweepy/client.py index a104952..8848afb 100644 --- a/tweepy/client.py +++ b/tweepy/client.py @@ -156,7 +156,7 @@ class Client: 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" + "%Y-%m-%dT%H:%M:%SZ" ) # TODO: Constant datetime format string? else: