mirror of https://github.com/Mikaela/Limnoria.git
Allow utils.str.timestamp to take a struct_time as argument.
This commit is contained in:
parent
c51876b4d6
commit
af24192b0f
|
@ -374,7 +374,8 @@ registerChannelValue(supybot.reply.format, 'time',
|
||||||
def timestamp(t):
|
def timestamp(t):
|
||||||
if t is None:
|
if t is None:
|
||||||
t = time.time()
|
t = time.time()
|
||||||
t = time.localtime(t)
|
elif isinstance(t, int):
|
||||||
|
t = time.localtime(t)
|
||||||
format = get(supybot.reply.format.time, dynamic.channel)
|
format = get(supybot.reply.format.time, dynamic.channel)
|
||||||
return time.strftime(format, t)
|
return time.strftime(format, t)
|
||||||
utils.str.timestamp = timestamp
|
utils.str.timestamp = timestamp
|
||||||
|
|
Loading…
Reference in New Issue