From e6535eb6bc3f9df93be176c702c730153d055f7c Mon Sep 17 00:00:00 2001 From: Krateng Date: Tue, 1 Dec 2020 19:19:01 +0100 Subject: [PATCH] Adjusted predefined ranges to consider timezone --- maloja/malojatime.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/maloja/malojatime.py b/maloja/malojatime.py index 5ca28a5..89aae20 100644 --- a/maloja/malojatime.py +++ b/maloja/malojatime.py @@ -383,18 +383,18 @@ y = MTime(2020) def today(): - tod = datetime.datetime.utcnow() + tod = datetime.datetime.now(tz=TIMEZONE) return MTime(tod.year,tod.month,tod.day) def thisweek(): - tod = datetime.datetime.utcnow() + tod = datetime.datetime.now(tz=TIMEZONE) tod = datetime.date(tod.year,tod.month,tod.day) y,w,_ = tod.chrcalendar() return MTimeWeek(y,w) def thismonth(): - tod = datetime.datetime.utcnow() + tod = datetime.datetime.now(tz=TIMEZONE) return MTime(tod.year,tod.month) def thisyear(): - tod = datetime.datetime.utcnow() + tod = datetime.datetime.now(tz=TIMEZONE) return MTime(tod.year) def alltime(): return MRange(None,None)