From b1dbb4f0425b416714921ea1f22b5f11916395ae Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Sat, 24 May 2025 15:16:41 +1000 Subject: [PATCH] give up on timezone crap and use a hard-coded number again the python version in our container has no timezone data? --- zulip_bots/zulip_bots/schedulebot.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/zulip_bots/zulip_bots/schedulebot.py b/zulip_bots/zulip_bots/schedulebot.py index 2c45888..b5a1bec 100644 --- a/zulip_bots/zulip_bots/schedulebot.py +++ b/zulip_bots/zulip_bots/schedulebot.py @@ -76,9 +76,7 @@ def hour_to_shift(hour, start_time): """Converts an hour number into a datetime, shift number (0-3), shift name, and hour-of-shift (1-6)""" start_time = datetime.utcfromtimestamp(start_time) current_time = (start_time + timedelta(hours=hour)).replace(minute=0, second=0, microsecond=0) - utc = ZoneInfo("UTC") - pst = ZoneInfo("America/Vancouver") - current_time_pst = current_time.replace(tzinfo=utc).astimezone(pst) + current_time_pst = current_time - timedelta(hours=7) # TODO change this back to 8 hour_pst = current_time_pst.hour shift = hour_pst // 6 shift_name = ["zeta", "dawn-guard", "alpha-flight", "night-watch"][shift]