From 3124aa6b0d999d8e7d2c3248cc241d58c878fc1a Mon Sep 17 00:00:00 2001 From: Martin Levy Date: Sun, 31 Dec 2023 11:11:43 -0800 Subject: [PATCH] easier date code --- examples/example_graphql.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/example_graphql.py b/examples/example_graphql.py index fa4bb51..7821e15 100755 --- a/examples/example_graphql.py +++ b/examples/example_graphql.py @@ -12,9 +12,9 @@ def now_iso8601_time(h_delta): """Cloudflare API code - example""" - t = time.time() - (h_delta * 3600) - r = datetime.datetime.fromtimestamp(int(t), tz=pytz.timezone("UTC")).strftime('%Y-%m-%dT%H:%M:%SZ') + # only use yyyy-mm-dd part for httpRequests1dGroups below + r = datetime.datetime.fromtimestamp(int(t), tz=pytz.timezone("UTC")).strftime('%Y-%m-%d') return r def main(): @@ -52,7 +52,7 @@ def main(): } } } - """ % (zone_id, date_before[0:10], date_after[0:10]) # only use yyyy-mm-dd part for httpRequests1dGroups + """ % (zone_id, date_before, date_after) # query - always a post try: