From 9690b606e0413145e31f156cb8ab9d706fb8955a Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 24 May 2024 13:14:12 +0200 Subject: [PATCH] utils with now --- util.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 util.py diff --git a/util.py b/util.py new file mode 100644 index 0000000..57c33f0 --- /dev/null +++ b/util.py @@ -0,0 +1,7 @@ +from datetime import datetime, timezone + + +def now(): + timestamp = datetime.now(timezone.utc).replace(microsecond=0) + formatted_timestamp = timestamp.strftime("%Y-%m-%dT%H:%M:%SZ") + return formatted_timestamp