From c91e9cb8d8e6f0bf5edc0f5768f8dfd50a23d44f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Gl=C3=BCpker?= Date: Tue, 16 Feb 2021 18:19:42 +0100 Subject: Show some stats and have links on premade finder --- main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'main.py') diff --git a/main.py b/main.py index f5def41..e39eb5f 100755 --- a/main.py +++ b/main.py @@ -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 = [] -- cgit v1.2.3