diff --git a/src/conf.py b/src/conf.py index 3407a36c0..027ae485c 100644 --- a/src/conf.py +++ b/src/conf.py @@ -282,6 +282,8 @@ registerChannelValue(supybot.reply.format, 'time', for the time module to see valid formatting characters for time formats.""")) def timestamp(t): + if t is None: + t = time.time() t = time.localtime(t) format = conf.get(supybot.reply.format.time, dynamic.channel) return time.strftime(format, t) diff --git a/src/utils/str.py b/src/utils/str.py index bd24032d1..f96a813f1 100644 --- a/src/utils/str.py +++ b/src/utils/str.py @@ -334,6 +334,8 @@ def toBool(s): # Replace me! def timestamp(t): + if t is None: + t = time.time() return time.ctime(t) _formatRe = re.compile('%([bfhiLnpqstu%])')