From 849388f56c735df9387a8000eee937de4d2b621e Mon Sep 17 00:00:00 2001 From: Martin Sekera Date: Sat, 9 Oct 2021 17:30:24 +0200 Subject: [PATCH] fix dt.now returning broken timezones --- dec8/dt.py | 9 ++++++--- setup.py | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dec8/dt.py b/dec8/dt.py index fcd103b..781878a 100644 --- a/dec8/dt.py +++ b/dec8/dt.py @@ -6,11 +6,14 @@ import datetime import pytz -def now(tz_name="UTC"): - t = datetime.datetime.now() - tz = pytz.timezone(tz_name) +def utcnow(): + t = datetime.datetime.utcnow() + tz = pytz.timezone("UTC") return tz.localize(t) +def now(): + return utcnow().astimezone() + # ---------------------------------------------------------------- diff --git a/setup.py b/setup.py index 9b824b2..d592e4e 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( version = "0.2.0", author = "Decade", packages = ["dec8"], - url = "https://git.decade.cz/decade/dec8/", + url = "https://git.decade.cz/decade-public/dec8/", license = "LICENSE", description = "Decadic toolkit.", install_requires = [