added unixtolocal()
This commit is contained in:
parent
a7fb575a55
commit
d46fe77dca
|
@ -69,3 +69,11 @@ def idleTimeWulf(result, bot):
|
|||
t = datetime.datetime.fromtimestamp(int(signon))
|
||||
delta = datetime.datetime.now() - t
|
||||
bot.msg("Adalwulf" + "_"*delta.days)
|
||||
|
||||
|
||||
@commands('unix')
|
||||
def unixtolocal(bot, trigger):
|
||||
"""Converts the given timestamp from unix time to local time."""
|
||||
unix = int(trigger.group(2))
|
||||
dt = datetime.datetime.utcfromtimestamp(unix).strftime('%Y-%m-%d %H:%M:%S')
|
||||
bot.msg(dt)
|
||||
|
|
Loading…
Reference in New Issue
Block a user