From 615476a2c039343284c973b615ef52d6bbd62c88 Mon Sep 17 00:00:00 2001 From: Jacob Bremiller <48461435+jacob1421@users.noreply.github.com> Date: Thu, 27 Jan 2022 16:21:14 -0600 Subject: [PATCH] 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." --- tweepy/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: -- 2.25.1