From af24192b0f8c9db4ee803b8c1bc1366c8b64de0f Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Thu, 31 Jul 2014 18:44:00 +0200 Subject: [PATCH] Allow utils.str.timestamp to take a struct_time as argument. --- src/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/conf.py b/src/conf.py index b99feecf4..8015ae60a 100644 --- a/src/conf.py +++ b/src/conf.py @@ -374,7 +374,8 @@ registerChannelValue(supybot.reply.format, 'time', def timestamp(t): if t is None: t = time.time() - t = time.localtime(t) + elif isinstance(t, int): + t = time.localtime(t) format = get(supybot.reply.format.time, dynamic.channel) return time.strftime(format, t) utils.str.timestamp = timestamp