diff --git a/modules/uptime.py b/modules/uptime.py index 62070cf..e1ab8b8 100755 --- a/modules/uptime.py +++ b/modules/uptime.py @@ -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)