refactor format_ms_time to misc.py

This commit is contained in:
Matthias Voppichler
2018-03-25 13:38:17 +02:00
parent 016232a8e9
commit f51ef1a791
2 changed files with 12 additions and 9 deletions

View File

@@ -72,3 +72,11 @@ def file_dump_json(filename, data) -> None:
"""
with open(filename, 'w') as fp:
json.dump(data, fp, default=str)
def format_ms_time(date: str) -> str:
"""
convert MS date to readable format.
: epoch-string in ms
"""
return datetime.fromtimestamp(date/1000.0).strftime('%Y-%m-%dT%H:%M:%S')