CLI: move format_time to common + add timezone
This commit is contained in:
parent
d2ae4a124a
commit
44a54978b9
1 changed files with 14 additions and 14 deletions
|
|
@ -52,6 +52,16 @@ SECURE_UNLINK_DIR = ".backup"
|
|||
METADATA_SUFF = "_metadata.json"
|
||||
|
||||
|
||||
def format_time(timestamp):
|
||||
"""Return formatted date for timestamp
|
||||
|
||||
@param timestamp(str,int,float): unix timestamp
|
||||
@return (unicode): formatted date
|
||||
"""
|
||||
fmt = "%d/%m/%Y %H:%M:%S %Z"
|
||||
return time.strftime(fmt, time.localtime(float(timestamp)))
|
||||
|
||||
|
||||
def ansi_ljust(s, width):
|
||||
"""ljust method handling ANSI escape codes"""
|
||||
cleaned = regex.ansiRemove(s)
|
||||
|
|
|
|||
Loading…
Reference in a new issue