add standardsubstitute vars 'utc' and 'gmt' which output current time in UTC.

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
This commit is contained in:
Daniel Folkinshteyn 2010-03-08 17:24:00 -05:00 committed by James Vega
parent 2c9f325cf4
commit 51eac7da5b
1 changed files with 2 additions and 0 deletions

View File

@ -644,6 +644,7 @@ def standardSubstitute(irc, msg, text, env=None):
return 'someone'
ctime = time.strftime("%a %b %d %H:%M:%S %Y")
localtime = time.localtime()
gmtime = time.strftime("%a %b %d %H:%M:%S %Y", time.gmtime())
vars = CallableValueIrcDict({
'who': msg.nick,
'nick': msg.nick,
@ -652,6 +653,7 @@ def standardSubstitute(irc, msg, text, env=None):
'channel': channel,
'botnick': irc.nick,
'now': ctime, 'ctime': ctime,
'utc': gmtime, 'gmt': gmtime,
'randnick': randNick, 'randomnick': randNick,
'randdate': randDate, 'randomdate': randDate,
'rand': randInt, 'randint': randInt, 'randomint': randInt,