Allow input of timestamp if not present time should be used.

This commit is contained in:
Roland Hedberg
2014-02-05 09:32:11 +01:00
parent a7e5f4ac92
commit 2197431484

View File

@@ -250,8 +250,11 @@ def str_to_time(timestr, format=TIME_FORMAT):
return time.gmtime(calendar.timegm(then))
def instant(format=TIME_FORMAT):
return time.strftime(format, time.gmtime())
def instant(format=TIME_FORMAT, time_stamp=0):
if time_stamp:
return time.strftime(format, time_stamp)
else:
return time.strftime(format, time.gmtime())
# ---------------------------------------------------------------------------