Mercurial > libervia-backend
diff sat_frontends/jp/common.py @ 3715:b9718216a1c0 0.9
merge bookmark 0.9
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 01 Dec 2021 16:13:31 +0100 |
parents | 742e466fa000 |
children | 524856bd7b19 |
line wrap: on
line diff
--- a/sat_frontends/jp/common.py Tue Nov 30 23:31:09 2021 +0100 +++ b/sat_frontends/jp/common.py Wed Dec 01 16:13:31 2021 +0100 @@ -53,6 +53,16 @@ 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)