Allow input of timestamp if not present time should be used.
This commit is contained in:
@@ -250,8 +250,11 @@ def str_to_time(timestr, format=TIME_FORMAT):
|
|||||||
return time.gmtime(calendar.timegm(then))
|
return time.gmtime(calendar.timegm(then))
|
||||||
|
|
||||||
|
|
||||||
def instant(format=TIME_FORMAT):
|
def instant(format=TIME_FORMAT, time_stamp=0):
|
||||||
return time.strftime(format, time.gmtime())
|
if time_stamp:
|
||||||
|
return time.strftime(format, time_stamp)
|
||||||
|
else:
|
||||||
|
return time.strftime(format, time.gmtime())
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user