Allow utils.str.timestamp to take a struct_time as argument.

This commit is contained in:
Valentin Lorentz 2014-07-31 18:44:00 +02:00
parent c51876b4d6
commit af24192b0f

View File

@ -374,6 +374,7 @@ registerChannelValue(supybot.reply.format, 'time',
def timestamp(t):
if t is None:
t = time.time()
elif isinstance(t, int):
t = time.localtime(t)
format = get(supybot.reply.format.time, dynamic.channel)
return time.strftime(format, t)