From 429377564bcbf8ac9e42d3329af7c9ddb61e68ce Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sat, 30 Sep 2023 15:06:39 +0200 Subject: [PATCH] fix bug with day zero having weird timezone offset --- service | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/service b/service index c989111..82c4f77 100755 --- a/service +++ b/service @@ -28,10 +28,8 @@ def idle(seconds, event_start, event_tz): event_now = datetime.now(event_tz) utc_now = datetime.now(pytz.utc) - utc_offset = (event_now - utc_now).total_seconds() - - day_zero = event_start.replace( - hour=0, minute=0, second=0, tzinfo=event_tz + day_zero = event_tz.localize( + event_start.replace(hour=0, minute=0, second=0) ) - timedelta(days=1) day_info = event_now - day_zero