From a06f51c49c3fd860c64426f1c937b029f44315a5 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 7 Nov 2022 18:00:41 -0800 Subject: [PATCH] Add timetools.py. I realize this is kind of stupid, but it means I never have to think about the correct incantation again, and all my projects will be on the same page with regards to correct utc timestamp. --- voussoirkit/timetools.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 voussoirkit/timetools.py diff --git a/voussoirkit/timetools.py b/voussoirkit/timetools.py new file mode 100644 index 0000000..a0c9bef --- /dev/null +++ b/voussoirkit/timetools.py @@ -0,0 +1,7 @@ +import datetime + +def now(): + return datetime.datetime.now(tz=datetime.timezone.utc) + +def now_local(): + return datetime.datetime.now().astimezone()