Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
easier date code
Browse files Browse the repository at this point in the history
  • Loading branch information
mahtin committed Dec 31, 2023
1 parent 08d9d4c commit 3124aa6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/example_graphql.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 3124aa6

Please sign in to comment.