From e4df14c3b76ffeccd14764c26789521bb41c31a3 Mon Sep 17 00:00:00 2001 From: plate Date: Sun, 2 Feb 2025 06:31:39 +0000 Subject: [PATCH] use nice timestamps (like ISO 8601) --- bot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index b1ce929..f4d4b98 100644 --- a/bot.py +++ b/bot.py @@ -1,6 +1,7 @@ import simplematrixbotlib as botLibrary import json import fetch +import time version = "0.3.0" @@ -76,8 +77,9 @@ async def make_choice(room, message): def formatData(data): if data is not None: + timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(data['created'])) dataToFormat = data - created = str(data['created']) + created = timestamp description = str(data['desc']) imageid = str(data['iid']) ocr = str(data['ocr'])