aboutsummaryrefslogtreecommitdiff
path: root/modules/user_time.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-11-01 16:06:35 +0000
committerGravatar jesopo2019-11-01 16:06:35 +0000
commit79beb17aa3d7e6747f08a4e8024d4d797ab9caa2 (patch)
tree96b28adfd504ea82bbe6bb0bb1f10982713c123c /modules/user_time.py
parentsupport "event category" for github so we can e.g. show only approvals (diff)
signature
show GMT offset in !time output
Diffstat (limited to 'modules/user_time.py')
-rw-r--r--modules/user_time.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/user_time.py b/modules/user_time.py
index cd51c9fb..043f2d3f 100644
--- a/modules/user_time.py
+++ b/modules/user_time.py
@@ -51,13 +51,19 @@ class Module(ModuleManager.BaseModule):
if not timezone == None:
dt = datetime.datetime.now(tz=pytz.timezone(timezone))
+ gmt_offset = (dt.utcoffset().total_seconds()/60)/60
+ tz = "GMT"
+ if not gmt_offset == 0.0:
+ if gmt_offset > 0:
+ tz += "+"
+ tz += "%g" % gmt_offset
human = utils.datetime_human(dt)
out = None
if type == LocationType.USER:
- out = "Time for %s: %s" % (name, human)
+ out = "Time for %s: %s %s" % (name, human, tz)
else:
- out = "It is %s in %s" % (human, name)
+ out = "It is %s in %s %s" % (human, name, tz)
event["stdout"].write(out)
else:
out = None