mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Allow timestamps in format to be None, indicating the current time.
This commit is contained in:
parent
0c2da03a67
commit
f44be3b864
@ -282,6 +282,8 @@ registerChannelValue(supybot.reply.format, 'time',
|
|||||||
for the time module to see valid formatting characters for time
|
for the time module to see valid formatting characters for time
|
||||||
formats."""))
|
formats."""))
|
||||||
def timestamp(t):
|
def timestamp(t):
|
||||||
|
if t is None:
|
||||||
|
t = time.time()
|
||||||
t = time.localtime(t)
|
t = time.localtime(t)
|
||||||
format = conf.get(supybot.reply.format.time, dynamic.channel)
|
format = conf.get(supybot.reply.format.time, dynamic.channel)
|
||||||
return time.strftime(format, t)
|
return time.strftime(format, t)
|
||||||
|
@ -334,6 +334,8 @@ def toBool(s):
|
|||||||
|
|
||||||
# Replace me!
|
# Replace me!
|
||||||
def timestamp(t):
|
def timestamp(t):
|
||||||
|
if t is None:
|
||||||
|
t = time.time()
|
||||||
return time.ctime(t)
|
return time.ctime(t)
|
||||||
|
|
||||||
_formatRe = re.compile('%([bfhiLnpqstu%])')
|
_formatRe = re.compile('%([bfhiLnpqstu%])')
|
||||||
|
Loading…
Reference in New Issue
Block a user