diff options
Diffstat (limited to 'main.py')
-rwxr-xr-x | main.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -42,7 +42,10 @@ intervals = ( ('s', 1), ) -def display_time(seconds, granularity=2): +def display_time(timestamp, format="%d.%m.%Y"): + return datetime.datetime.fromtimestamp(timestamp).strftime(format) + +def display_age(seconds, granularity=2): result = [] for name, count in intervals: value = seconds // count @@ -54,6 +57,7 @@ def display_time(seconds, granularity=2): return ' '.join(result[:granularity]) app.jinja_env.filters['display_time'] = display_time +app.jinja_env.filters['display_age'] = display_age def grepSteamids(text): steamids = [] |