Fixed date formatting for datetime objects
authorJacob Bremiller <48461435+jacob1421@users.noreply.github.com>
Thu, 27 Jan 2022 22:21:14 +0000 (16:21 -0600)
committerJacob Bremiller <48461435+jacob1421@users.noreply.github.com>
Thu, 27 Jan 2022 22:21:14 +0000 (16:21 -0600)
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."

tweepy/client.py

index a104952bf282c26662b4074ab1cea2e759e38b82..8848afbac4d1b0868fc46e8886ae3f0629939c5f 100644 (file)
@@ -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: