summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py6
1 files changed, 5 insertions, 1 deletions
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 = []