From fc0e6bdce050b323afe9c91ec2e3d58577321af4 Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 1 Jan 2020 11:27:24 +0000 Subject: [PATCH] if a timezone isn't found, prepend it with "Etc/" (for e.g. "Etc/GMT+1") --- modules/user_time.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/user_time.py b/modules/user_time.py index 48077d81..11c46ff6 100644 --- a/modules/user_time.py +++ b/modules/user_time.py @@ -45,6 +45,8 @@ class Module(ModuleManager.BaseModule): return LocationType.NAME, event["args"], None def _timezoned(self, dt, timezone): + if not timezone in pytz.all_timezones: + timezone = "Etc/%s" % timezone dt = dt.astimezone(pytz.timezone(timezone)) utc_offset = (dt.utcoffset().total_seconds()/60)/60 tz = "UTC"