From 86d20cc0a8c994967452fa43dd8b51c931619b4d Mon Sep 17 00:00:00 2001 From: Krateng Date: Sun, 14 Apr 2019 15:08:56 +0200 Subject: [PATCH] Fixed timezone bug --- malojatime.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/malojatime.py b/malojatime.py index 77bcbde..132a1f3 100644 --- a/malojatime.py +++ b/malojatime.py @@ -47,6 +47,7 @@ class expandeddate(datetime.date): cal = tomorrow.isocalendar() return (cal[0],cal[1],cal[2] % 7) + date = expandeddate @@ -612,17 +613,18 @@ def ranges(since=None,to=None,within=None,timerange=None,step="month",stepn=1,tr def today(): - tod = date.today() + tod = datetime.datetime.utcnow() return MTime(tod.year,tod.month,tod.day) def thisweek(): - tod = date.today() + tod = datetime.datetime.utcnow() + tod = date(tod.year,tod.month,tod.day) y,w,_ = tod.chrcalendar() return MTimeWeek(y,w) def thismonth(): - tod = date.today() + tod = datetime.datetime.utcnow() return MTime(tod.year,tod.month) def thisyear(): - tod = date.today() + tod = datetime.datetime.utcnow() return MTime(tod.year) #def _get_start_of(timestamp,unit):