if a timezone isn't found, prepend it with "Etc/" (for e.g. "Etc/GMT+1")
This commit is contained in:
parent
9efb0b05fc
commit
fc0e6bdce0
1 changed files with 2 additions and 0 deletions
|
@ -45,6 +45,8 @@ class Module(ModuleManager.BaseModule):
|
||||||
return LocationType.NAME, event["args"], None
|
return LocationType.NAME, event["args"], None
|
||||||
|
|
||||||
def _timezoned(self, dt, timezone):
|
def _timezoned(self, dt, timezone):
|
||||||
|
if not timezone in pytz.all_timezones:
|
||||||
|
timezone = "Etc/%s" % timezone
|
||||||
dt = dt.astimezone(pytz.timezone(timezone))
|
dt = dt.astimezone(pytz.timezone(timezone))
|
||||||
utc_offset = (dt.utcoffset().total_seconds()/60)/60
|
utc_offset = (dt.utcoffset().total_seconds()/60)/60
|
||||||
tz = "UTC"
|
tz = "UTC"
|
||||||
|
|
Loading…
Reference in a new issue